diff --git a/check_run/check_run/custom/bank.json b/check_run/check_run/custom/bank.json index 232f13ac..bea0a573 100644 --- a/check_run/check_run/custom/bank.json +++ b/check_run/check_run/custom/bank.json @@ -38,6 +38,7 @@ "mandatory_depends_on": null, "modified": "2022-08-07 15:07:53.297493", "modified_by": "Administrator", + "module": "Check Run", "name": "Bank-aba_number", "no_copy": 0, "non_negative": 0, diff --git a/check_run/check_run/custom/bank_account.json b/check_run/check_run/custom/bank_account.json index e3517118..5633922e 100644 --- a/check_run/check_run/custom/bank_account.json +++ b/check_run/check_run/custom/bank_account.json @@ -37,6 +37,7 @@ "length": 0, "mandatory_depends_on": null, "modified": "2022-06-30 11:20:02.666689", + "module": "Check Run", "modified_by": "Administrator", "name": "Bank Account-check_number", "no_copy": 0, diff --git a/check_run/check_run/custom/mode_of_payment.json b/check_run/check_run/custom/mode_of_payment.json index 0e7a4ab4..d99c3786 100644 --- a/check_run/check_run/custom/mode_of_payment.json +++ b/check_run/check_run/custom/mode_of_payment.json @@ -17,6 +17,7 @@ "idx": 0, "modified": "2022-08-05 13:10:55.278054", "modified_by": "Administrator", + "module": "Check Run", "name": "Mode of Payment-type-options", "owner": "Administrator", "parent": null, @@ -29,4 +30,4 @@ } ], "sync_on_migrate": 1 -} +} \ No newline at end of file diff --git a/check_run/check_run/custom/payment_entry.json b/check_run/check_run/custom/payment_entry.json index 4c2820a6..3df21d4b 100644 --- a/check_run/check_run/custom/payment_entry.json +++ b/check_run/check_run/custom/payment_entry.json @@ -38,6 +38,7 @@ "mandatory_depends_on": null, "modified": "2022-06-30 11:20:02.666689", "modified_by": "Administrator", + "module": "Check Run", "name": "Payment Entry-check_run", "no_copy": 0, "non_negative": 0, diff --git a/check_run/check_run/custom/purchase_invoice.json b/check_run/check_run/custom/purchase_invoice.json index f512866e..0c36646f 100644 --- a/check_run/check_run/custom/purchase_invoice.json +++ b/check_run/check_run/custom/purchase_invoice.json @@ -38,6 +38,7 @@ "mandatory_depends_on": null, "modified": "2022-06-30 11:20:02.666689", "modified_by": "Administrator", + "module": "Check Run", "name": "Purchase Invoice-supplier_default_mode_of_payment", "no_copy": 0, "non_negative": 0, diff --git a/check_run/check_run/custom/supplier.json b/check_run/check_run/custom/supplier.json index f055a988..f2732b68 100644 --- a/check_run/check_run/custom/supplier.json +++ b/check_run/check_run/custom/supplier.json @@ -40,7 +40,7 @@ "mandatory_depends_on": null, "modified": "2022-06-30 11:20:02.666689", "modified_by": "Administrator", - "module": null, + "module": "Check Run", "name": "Supplier-bank_account", "no_copy": 0, "non_negative": 0, @@ -100,7 +100,7 @@ "mandatory_depends_on": null, "modified": "2022-06-30 11:20:02.666689", "modified_by": "Administrator", - "module": null, + "module": "Check Run", "name": "Supplier-supplier_default_mode_of_payment", "no_copy": 0, "non_negative": 0, @@ -119,199 +119,10 @@ "translatable": 0, "unique": 0, "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2023-02-28 11:16:08.858761", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Supplier", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "irs_1099", - "fieldtype": "Check", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_id", - "is_system_generated": 1, - "is_virtual": 0, - "label": "Is IRS 1099 reporting required for supplier?", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-02-28 11:16:08.858761", - "modified_by": "Administrator", - "module": null, - "name": "Supplier-irs_1099", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 1, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2022-06-30 11:20:02.666689", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Supplier", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "bank", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 33, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "supplier_default_mode_of_payment", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Bank", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-02-28 11:29:22.518036", - "modified_by": "Administrator", - "module": null, - "name": "Supplier-bank", - "no_copy": 0, - "non_negative": 0, - "options": "Bank", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 0, - "unique": 0, - "width": null } ], "custom_perms": [], "doctype": "Supplier", - "links": [ - { - "creation": "2013-01-10 16:34:11", - "custom": 0, - "docstatus": 0, - "group": "Allowed Items", - "hidden": 0, - "idx": 1, - "is_child_table": 0, - "link_doctype": "Party Specific Item", - "link_fieldname": "party", - "modified": "2023-02-28 21:44:41.878474", - "modified_by": "Administrator", - "name": "62e88989a8", - "owner": "Administrator", - "parent": "Supplier", - "parent_doctype": null, - "parentfield": "links", - "parenttype": "DocType", - "table_fieldname": null - } - ], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-02-28 11:16:11.179371", - "default_value": null, - "doc_type": "Supplier", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "naming_series", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-02-28 11:16:11.179371", - "modified_by": "Administrator", - "module": null, - "name": "Supplier-naming_series-hidden", - "owner": "Administrator", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-02-28 11:16:11.027773", - "default_value": null, - "doc_type": "Supplier", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "naming_series", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-02-28 11:16:11.027773", - "modified_by": "Administrator", - "module": null, - "name": "Supplier-naming_series-reqd", - "owner": "Administrator", - "property": "reqd", - "property_type": "Check", - "row_name": null, - "value": "0" - } - ], + "property_setters": [], "sync_on_migrate": 1 } diff --git a/check_run/customize.py b/check_run/customize.py index 83d14e93..b91ffe43 100644 --- a/check_run/customize.py +++ b/check_run/customize.py @@ -12,6 +12,8 @@ def load_customizations(): for file in files: customizations = json.loads(Path(file).read_text()) for field in customizations.get("custom_fields"): + if field.get("module") != "Check Run": + continue existing_field = frappe.get_value("Custom Field", field.get("name")) custom_field = ( frappe.get_doc("Custom Field", field.get("name")) @@ -24,6 +26,8 @@ def load_customizations(): custom_field.flags.ignore_version = True custom_field.save() for prop in customizations.get("property_setters"): + if prop.get("module") != "Check Run": + continue property_setter = frappe.get_doc( { "name": prop.get("name"),