diff --git a/erpnext_germany/hooks.py b/erpnext_germany/hooks.py index 531e413..e37125e 100644 --- a/erpnext_germany/hooks.py +++ b/erpnext_germany/hooks.py @@ -244,8 +244,8 @@ def get_register_fields(insert_after: str): germany_custom_fields = { "Company": [] + get_register_fields(insert_after="address_html"), - "Customer": [] + get_register_fields(insert_after="disabled"), - "Supplier": [] + get_register_fields(insert_after="prevent_pos"), + "Customer": [] + get_register_fields(insert_after="companies"), + "Supplier": [] + get_register_fields(insert_after="companies"), "Employee": [ { "fieldtype": "Link", diff --git a/erpnext_germany/patches.txt b/erpnext_germany/patches.txt index 95ccad4..de2c1a8 100644 --- a/erpnext_germany/patches.txt +++ b/erpnext_germany/patches.txt @@ -1,3 +1,4 @@ execute:from erpnext_germany.install import after_install; after_install() # 7 erpnext_germany.patches.add_tax_exemption_reason_fields execute:from erpnext_germany.install import insert_custom_records; insert_custom_records() +erpnext_germany.patches.change_position_of_register_info diff --git a/erpnext_germany/patches/change_position_of_register_info.py b/erpnext_germany/patches/change_position_of_register_info.py new file mode 100644 index 0000000..a327657 --- /dev/null +++ b/erpnext_germany/patches/change_position_of_register_info.py @@ -0,0 +1,11 @@ +import frappe + + +def execute(): + """Update the position of the Register Information section in Customer and Supplier.""" + for dt in ("Customer", "Supplier"): + cf = frappe.db.exists("Custom Field", {"fieldname": "register_sb_1", "dt": dt}) + if not cf: + continue + + frappe.db.set_value("Custom Field", cf, "insert_after", "companies")