Skip to content

Commit

Permalink
fix: position of register information
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Jan 8, 2024
1 parent 559b1ea commit ee8a1b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext_germany/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions erpnext_germany/patches.txt
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions erpnext_germany/patches/change_position_of_register_info.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit ee8a1b7

Please sign in to comment.