From 517561f1b2ae655a665d0246282663d39de35b87 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Tue, 17 Jun 2025 11:44:28 +0530 Subject: [PATCH 1/3] feat: add site code doctype --- suppliers_portal/hooks.py | 2 + .../doctype/site_code/__init__.py | 0 .../doctype/site_code/site_code.js | 12 ++++ .../doctype/site_code/site_code.json | 62 +++++++++++++++++++ .../doctype/site_code/site_code.py | 24 +++++++ .../doctype/site_code/test_site_code.py | 9 +++ 6 files changed, 109 insertions(+) create mode 100644 suppliers_portal/suppliers_portal/doctype/site_code/__init__.py create mode 100644 suppliers_portal/suppliers_portal/doctype/site_code/site_code.js create mode 100644 suppliers_portal/suppliers_portal/doctype/site_code/site_code.json create mode 100644 suppliers_portal/suppliers_portal/doctype/site_code/site_code.py create mode 100644 suppliers_portal/suppliers_portal/doctype/site_code/test_site_code.py diff --git a/suppliers_portal/hooks.py b/suppliers_portal/hooks.py index 5402507..93d4742 100644 --- a/suppliers_portal/hooks.py +++ b/suppliers_portal/hooks.py @@ -246,3 +246,5 @@ website_route_rules = [ {"from_route": "/supplier-portal/", "to_route": "supplier-portal"}, {"from_route": "/erpnext", "to_route": "/app"}, ] + +export_python_type_annotations = True diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/__init__.py b/suppliers_portal/suppliers_portal/doctype/site_code/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js new file mode 100644 index 0000000..8fbbc6b --- /dev/null +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js @@ -0,0 +1,12 @@ +// Copyright (c) 2025, jeowsome15@gmail.com and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Site Code", { + refresh(frm) { + if (!frm.doc.__islocal) { + frappe.contacts.render_address_and_contact(frm) + } else { + frappe.contacts.clear_address_and_contact(frm) + } + }, +}); diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json new file mode 100644 index 0000000..ed6bc27 --- /dev/null +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json @@ -0,0 +1,62 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2025-06-17 01:51:35.709515", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "site_code", + "column_break_pwyn", + "address_html" + ], + "fields": [ + { + "fieldname": "site_code", + "fieldtype": "Data", + "in_global_search": 1, + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, + "label": "Site Code", + "no_copy": 1, + "not_nullable": 1, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break_pwyn", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval: !doc.__islocal", + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2025-06-17 02:11:43.902766", + "modified_by": "Administrator", + "module": "Suppliers Portal", + "name": "Site Code", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py new file mode 100644 index 0000000..bd8befb --- /dev/null +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py @@ -0,0 +1,24 @@ +# Copyright (c) 2025, jeowsome15@gmail.com and contributors +# For license information, please see license.txt + +from frappe.model.document import Document +from frappe.contacts.address_and_contact import delete_contact_and_address, load_address_and_contact + + +class SiteCode(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + site_code: DF.Data + # end: auto-generated types + + def onload(self): + load_address_and_contact(self) + + def on_trash(self): + delete_contact_and_address("Site Code", self.name) diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/test_site_code.py b/suppliers_portal/suppliers_portal/doctype/site_code/test_site_code.py new file mode 100644 index 0000000..febb2ee --- /dev/null +++ b/suppliers_portal/suppliers_portal/doctype/site_code/test_site_code.py @@ -0,0 +1,9 @@ +# Copyright (c) 2025, jeowsome15@gmail.com and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestSiteCode(FrappeTestCase): + pass -- 2.50.1 From bf0c3130e621dba1d171d181f4ad752d7d98829a Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Tue, 17 Jun 2025 11:45:28 +0530 Subject: [PATCH 2/3] ci: add pre-commit fixes --- supplier-portal/src/pages/NewInvoice.vue | 6 +- supplier-portal/src/pages/SupplierInvoice.vue | 6 +- .../patches/move_invoices_to_erpnext.py | 12 +- .../public/supplier-portal/index.html | 2 +- .../custom/purchase_invoice.json | 270 +++++++++--------- .../doctype/site_code/site_code.js | 4 +- .../doctype/site_code/site_code.json | 118 ++++---- .../doctype/site_code/site_code.py | 2 +- suppliers_portal/www/supplier-portal.html | 2 +- 9 files changed, 204 insertions(+), 218 deletions(-) diff --git a/supplier-portal/src/pages/NewInvoice.vue b/supplier-portal/src/pages/NewInvoice.vue index 9f71c5c..7cd1eab 100644 --- a/supplier-portal/src/pages/NewInvoice.vue +++ b/supplier-portal/src/pages/NewInvoice.vue @@ -25,11 +25,7 @@
- +
diff --git a/supplier-portal/src/pages/SupplierInvoice.vue b/supplier-portal/src/pages/SupplierInvoice.vue index 0b21772..0dc5e89 100644 --- a/supplier-portal/src/pages/SupplierInvoice.vue +++ b/supplier-portal/src/pages/SupplierInvoice.vue @@ -288,14 +288,14 @@ const documents = reactive({}) const invoice = createDocumentResource({ doctype: 'Purchase Invoice', name: supplierInvoiceNumber, - onSuccess: (data) => { + onSuccess: data => { documents.invoice = data documents.address = createDocumentResource({ doctype: 'Address', name: data.supplier_address, - auto: true + auto: true, }) - } + }, }) diff --git a/suppliers_portal/patches/move_invoices_to_erpnext.py b/suppliers_portal/patches/move_invoices_to_erpnext.py index f8b8667..5477a6f 100644 --- a/suppliers_portal/patches/move_invoices_to_erpnext.py +++ b/suppliers_portal/patches/move_invoices_to_erpnext.py @@ -88,9 +88,7 @@ def setup_accounts(): force=True, ) update_account_number(f"1110 - Cash - {abbr}", "Petty Cash", account_number="1110") - update_account_number( - f"Primary Checking - {abbr}", "Primary Checking", account_number="1201" - ) + update_account_number(f"Primary Checking - {abbr}", "Primary Checking", account_number="1201") def create_fiscal_years(): @@ -324,9 +322,7 @@ def import_invoices(): "paid_from": get_account_name("Bank", "Asset"), "reference_no": payment.get("payment_reference_number") or "Note: Missing reference during ERPNext import", - "reference_date": getdate( - payment.get("payment_reference_date") - ), + "reference_date": getdate(payment.get("payment_reference_date")), "references": [ { "reference_doctype": invoice_doc.doctype, @@ -341,6 +337,4 @@ def import_invoices(): payment_doc.insert(ignore_permissions=True) payment_doc.submit() except Exception as e: - print( - f"Error importing payment for invoice {invoice_doc.bill_no}: {e}" - ) + print(f"Error importing payment for invoice {invoice_doc.bill_no}: {e}") diff --git a/suppliers_portal/public/supplier-portal/index.html b/suppliers_portal/public/supplier-portal/index.html index a6d8cb3..8f3a79b 100644 --- a/suppliers_portal/public/supplier-portal/index.html +++ b/suppliers_portal/public/supplier-portal/index.html @@ -16,6 +16,6 @@
- + diff --git a/suppliers_portal/suppliers_portal/custom/purchase_invoice.json b/suppliers_portal/suppliers_portal/custom/purchase_invoice.json index 3bddbcb..2d1de08 100644 --- a/suppliers_portal/suppliers_portal/custom/purchase_invoice.json +++ b/suppliers_portal/suppliers_portal/custom/purchase_invoice.json @@ -1,137 +1,137 @@ { - "custom_fields": [ - { - "_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": "2025-05-19 02:22:24.828657", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Purchase Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "service_date", - "fieldtype": "Date", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 12, - "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": "due_date", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Service Date", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2025-05-19 02:22:24.828657", - "modified_by": "Administrator", - "module": null, - "name": "Purchase Invoice-service_date", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "placeholder": null, - "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, - "show_dashboard": 0, - "sort_options": 0, - "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": "2025-05-19 02:22:24.721092", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Purchase Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "site_code", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 6, - "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": "company", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Site Code", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2025-05-19 02:22:24.721092", - "modified_by": "Administrator", - "module": null, - "name": "Purchase Invoice-site_code", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "placeholder": null, - "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, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 1, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Purchase Invoice", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 + "custom_fields": [ + { + "_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": "2025-05-19 02:22:24.828657", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Purchase Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "service_date", + "fieldtype": "Date", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 12, + "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": "due_date", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Service Date", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-05-19 02:22:24.828657", + "modified_by": "Administrator", + "module": null, + "name": "Purchase Invoice-service_date", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "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, + "show_dashboard": 0, + "sort_options": 0, + "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": "2025-05-19 02:22:24.721092", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Purchase Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "site_code", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 6, + "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": "company", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Site Code", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-05-19 02:22:24.721092", + "modified_by": "Administrator", + "module": null, + "name": "Purchase Invoice-site_code", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "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, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Purchase Invoice", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 } diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js index 8fbbc6b..b6fe717 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js @@ -1,7 +1,7 @@ // Copyright (c) 2025, jeowsome15@gmail.com and contributors // For license information, please see license.txt -frappe.ui.form.on("Site Code", { +frappe.ui.form.on('Site Code', { refresh(frm) { if (!frm.doc.__islocal) { frappe.contacts.render_address_and_contact(frm) @@ -9,4 +9,4 @@ frappe.ui.form.on("Site Code", { frappe.contacts.clear_address_and_contact(frm) } }, -}); +}) diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json index ed6bc27..7e7b57a 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json @@ -1,62 +1,58 @@ { - "actions": [], - "allow_rename": 1, - "creation": "2025-06-17 01:51:35.709515", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "site_code", - "column_break_pwyn", - "address_html" - ], - "fields": [ - { - "fieldname": "site_code", - "fieldtype": "Data", - "in_global_search": 1, - "in_list_view": 1, - "in_preview": 1, - "in_standard_filter": 1, - "label": "Site Code", - "no_copy": 1, - "not_nullable": 1, - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "column_break_pwyn", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval: !doc.__islocal", - "fieldname": "address_html", - "fieldtype": "HTML", - "label": "Address HTML", - "read_only": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2025-06-17 02:11:43.902766", - "modified_by": "Administrator", - "module": "Suppliers Portal", - "name": "Site Code", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "creation", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file + "actions": [], + "allow_rename": 1, + "creation": "2025-06-17 01:51:35.709515", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": ["site_code", "column_break_pwyn", "address_html"], + "fields": [ + { + "fieldname": "site_code", + "fieldtype": "Data", + "in_global_search": 1, + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, + "label": "Site Code", + "no_copy": 1, + "not_nullable": 1, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break_pwyn", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval: !doc.__islocal", + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2025-06-17 02:11:43.902766", + "modified_by": "Administrator", + "module": "Suppliers Portal", + "name": "Site Code", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py index bd8befb..9c41985 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py @@ -1,8 +1,8 @@ # Copyright (c) 2025, jeowsome15@gmail.com and contributors # For license information, please see license.txt -from frappe.model.document import Document from frappe.contacts.address_and_contact import delete_contact_and_address, load_address_and_contact +from frappe.model.document import Document class SiteCode(Document): diff --git a/suppliers_portal/www/supplier-portal.html b/suppliers_portal/www/supplier-portal.html index a6d8cb3..8f3a79b 100644 --- a/suppliers_portal/www/supplier-portal.html +++ b/suppliers_portal/www/supplier-portal.html @@ -16,6 +16,6 @@
- + -- 2.50.1 From 0230da2812119e5a8cf55ff5f89ce3d5c16b2567 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Tue, 17 Jun 2025 12:05:10 +0530 Subject: [PATCH 3/3] fix: extract site code from invoice --- .../patches/move_invoices_to_erpnext.py | 56 +++++++++++++++---- .../doctype/site_code/site_code.json | 15 +++-- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/suppliers_portal/patches/move_invoices_to_erpnext.py b/suppliers_portal/patches/move_invoices_to_erpnext.py index 5477a6f..aff3f26 100644 --- a/suppliers_portal/patches/move_invoices_to_erpnext.py +++ b/suppliers_portal/patches/move_invoices_to_erpnext.py @@ -1,4 +1,5 @@ import json +import re import frappe from erpnext.accounts.doctype.account.account import update_account_number @@ -253,12 +254,13 @@ def import_invoices(): if frappe.db.exists("Purchase Invoice", {"name": invoice.get("name")}): continue + site_code = get_site_code(invoice) invoice_doc = frappe.new_doc("Purchase Invoice") invoice_doc.update( { "supplier": invoice.get("supplier"), "bill_no": invoice.get("supplier_invoice_number"), - "site_code": invoice.get("site_code"), + "site_code": site_code or "", "set_posting_time": True, "bill_date": getdate(invoice.get("invoice_date")), "posting_date": getdate(invoice.get("invoice_date")), @@ -292,16 +294,35 @@ def import_invoices(): continue if invoice.get("street"): - address = create_address( - { - **invoice, - "title": invoice.get("supplier"), - "ref_doctype": "Supplier", - "ref_name": invoice.get("supplier"), - } - ) - invoice_doc.supplier_address = address.name - invoice_doc.save() + if site_code: + if frappe.db.exists("Site Code", site_code): + site_code_doc = frappe.get_doc("Site Code", site_code) + else: + site_code_doc = frappe.new_doc("Site Code") + site_code_doc.site_code = site_code + site_code_doc.save(ignore_permissions=True) + + address = create_address( + { + **invoice, + "title": site_code, + "ref_doctype": "Site Code", + "ref_name": site_code_doc.name, + } + ) + invoice_doc.dispatch_address = address.name + invoice_doc.save() + else: + address = create_address( + { + **invoice, + "title": invoice.get("supplier"), + "ref_doctype": "Supplier", + "ref_name": invoice.get("supplier"), + } + ) + invoice_doc.supplier_address = address.name + invoice_doc.save() try: invoice_doc.submit() @@ -338,3 +359,16 @@ def import_invoices(): payment_doc.submit() except Exception as e: print(f"Error importing payment for invoice {invoice_doc.bill_no}: {e}") + + +def get_site_code(invoice): + if invoice.get("site_code"): + return invoice["site_code"].upper() + + # try to find it in the notes + site_pattern = re.compile(r"\bsite\s+([A-Z0-9]+)", re.IGNORECASE) + notes = invoice.get("notes", "") + if notes: + matches = site_pattern.findall(notes) + if len(matches) > 0: + return ", ".join(matches).upper() diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json index 7e7b57a..ac14edc 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json @@ -1,10 +1,10 @@ { "actions": [], - "allow_rename": 1, + "autoname": "field:site_code", "creation": "2025-06-17 01:51:35.709515", "doctype": "DocType", "engine": "InnoDB", - "field_order": ["site_code", "column_break_pwyn", "address_html"], + "field_order": ["site_code", "column_break_pwyn", "addresses_section", "address_html"], "fields": [ { "fieldname": "site_code", @@ -29,14 +29,20 @@ "fieldtype": "HTML", "label": "Address HTML", "read_only": 1 + }, + { + "fieldname": "addresses_section", + "fieldtype": "Section Break", + "label": "Addresses" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2025-06-17 02:11:43.902766", + "modified": "2025-06-17 02:29:32.191624", "modified_by": "Administrator", "module": "Suppliers Portal", "name": "Site Code", + "naming_rule": "By fieldname", "owner": "Administrator", "permissions": [ { @@ -54,5 +60,6 @@ ], "sort_field": "creation", "sort_order": "DESC", - "states": [] + "states": [], + "title_field": "site_code" } -- 2.50.1