From 3eb838a6a27922b5e1af10bf2b518d35860163ea Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sun, 8 Feb 2026 20:36:24 +0530 Subject: [PATCH 1/4] refactor: supplier form cleanup (cherry picked from commit bd521d908991dd83f7a00b72708a95ec39c61219) # Conflicts: # erpnext/buying/doctype/supplier/supplier.json --- erpnext/buying/doctype/supplier/supplier.js | 14 ++-- erpnext/buying/doctype/supplier/supplier.json | 65 ++++++++++++++----- erpnext/buying/doctype/supplier/supplier.py | 2 - 3 files changed, 55 insertions(+), 26 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index fb4ef867ade..3f5d8dbca04 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -73,6 +73,12 @@ frappe.ui.form.on("Supplier", { }; }, + supplier_group(frm) { + if (frm.doc.supplier_group) { + frm.trigger("get_supplier_group_details"); + } + }, + refresh: function (frm) { if (frappe.defaults.get_default("supp_master_name") != "Naming Series") { frm.toggle_display("naming_series", false); @@ -111,14 +117,6 @@ frappe.ui.form.on("Supplier", { __("View") ); - frm.add_custom_button( - __("Get Supplier Group Details"), - function () { - frm.trigger("get_supplier_group_details"); - }, - __("Actions") - ); - if ( cint(frappe.defaults.get_default("enable_common_party_accounting")) && frappe.model.can_create("Party Link") diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 78b797d4c2b..7af2652472e 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -11,8 +11,14 @@ "engine": "InnoDB", "field_order": [ "naming_series", +<<<<<<< HEAD "supplier_name", "country", +======= + "supplier_type", + "supplier_name", + "gender", +>>>>>>> bd521d9089 (refactor: supplier form cleanup) "column_break0", "supplier_group", "supplier_type", @@ -23,24 +29,12 @@ "default_bank_account", "column_break_10", "default_price_list", - "internal_supplier_section", - "is_internal_supplier", - "represents_company", - "column_break_16", - "companies", "column_break2", "supplier_details", "column_break_30", "website", "language", "customer_numbers", - "dashboard_tab", - "tax_tab", - "tax_id", - "tax_category", - "column_break_27", - "tax_withholding_category", - "tax_withholding_group", "contact_and_address_tab", "address_contacts", "address_html", @@ -54,19 +48,35 @@ "supplier_primary_contact", "mobile_no", "email_id", + "tax_tab", + "tax_id", + "tax_category", + "column_break_27", + "tax_withholding_category", + "tax_withholding_group", "accounting_tab", "payment_terms", "default_accounts_section", "accounts", + "internal_supplier_section", + "is_internal_supplier", + "represents_company", + "column_break_16", + "companies", "settings_tab", "allow_purchase_invoice_creation_without_purchase_order", "allow_purchase_invoice_creation_without_purchase_receipt", "column_break_54", "is_frozen", +<<<<<<< HEAD "disabled", +======= + "rfq_and_purchase_order_settings_section", +>>>>>>> bd521d9089 (refactor: supplier form cleanup) "warn_rfqs", - "warn_pos", "prevent_rfqs", + "column_break_oxjw", + "warn_pos", "prevent_pos", "block_supplier_section", "on_hold", @@ -75,7 +85,11 @@ "release_date", "portal_users_tab", "portal_users", +<<<<<<< HEAD "column_break_1mqv" +======= + "dashboard_tab" +>>>>>>> bd521d9089 (refactor: supplier form cleanup) ], "fields": [ { @@ -398,7 +412,7 @@ { "fieldname": "dashboard_tab", "fieldtype": "Tab Break", - "label": "Dashboard", + "label": "Connections", "show_dashboard": 1 }, { @@ -430,7 +444,7 @@ "collapsible": 1, "fieldname": "internal_supplier_section", "fieldtype": "Section Break", - "label": "Internal Supplier" + "label": "Internal Supplier Accounting" }, { "fieldname": "column_break_16", @@ -488,6 +502,25 @@ "fieldtype": "Link", "label": "Tax Withholding Group", "options": "Tax Withholding Group" +<<<<<<< HEAD +======= + }, + { + "depends_on": "eval:doc.supplier_type == 'Individual'", + "fieldname": "gender", + "fieldtype": "Link", + "label": "Gender", + "options": "Gender" + }, + { + "fieldname": "rfq_and_purchase_order_settings_section", + "fieldtype": "Section Break", + "label": "RFQ and Purchase Order Settings" + }, + { + "fieldname": "column_break_oxjw", + "fieldtype": "Column Break" +>>>>>>> bd521d9089 (refactor: supplier form cleanup) } ], "grid_page_length": 50, @@ -501,7 +534,7 @@ "link_fieldname": "party" } ], - "modified": "2026-02-06 12:58:01.398824", + "modified": "2026-02-08 20:28:01.101808", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 543b3726089..cce408b264d 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -161,8 +161,6 @@ class Supplier(TransactionBase): if doc.payment_terms: self.payment_terms = doc.payment_terms - self.save() - def validate_internal_supplier(self): if not self.is_internal_supplier: self.represents_company = "" From 7a680e6070e8620bbfc1448806fa8ec1b3b97599 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 23 Feb 2026 11:05:07 +0530 Subject: [PATCH 2/4] chore: fix conflicts Refactored supplier form by reorganizing field order and removing unnecessary fields. --- erpnext/buying/doctype/supplier/supplier.json | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 7af2652472e..37fabcf2607 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -11,16 +11,12 @@ "engine": "InnoDB", "field_order": [ "naming_series", -<<<<<<< HEAD - "supplier_name", - "country", -======= "supplier_type", "supplier_name", "gender", ->>>>>>> bd521d9089 (refactor: supplier form cleanup) "column_break0", "supplier_group", + "country", "supplier_type", "is_transporter", "image", @@ -68,11 +64,8 @@ "allow_purchase_invoice_creation_without_purchase_receipt", "column_break_54", "is_frozen", -<<<<<<< HEAD "disabled", -======= "rfq_and_purchase_order_settings_section", ->>>>>>> bd521d9089 (refactor: supplier form cleanup) "warn_rfqs", "prevent_rfqs", "column_break_oxjw", @@ -85,11 +78,7 @@ "release_date", "portal_users_tab", "portal_users", -<<<<<<< HEAD - "column_break_1mqv" -======= "dashboard_tab" ->>>>>>> bd521d9089 (refactor: supplier form cleanup) ], "fields": [ { @@ -502,8 +491,6 @@ "fieldtype": "Link", "label": "Tax Withholding Group", "options": "Tax Withholding Group" -<<<<<<< HEAD -======= }, { "depends_on": "eval:doc.supplier_type == 'Individual'", @@ -520,7 +507,6 @@ { "fieldname": "column_break_oxjw", "fieldtype": "Column Break" ->>>>>>> bd521d9089 (refactor: supplier form cleanup) } ], "grid_page_length": 50, @@ -534,7 +520,7 @@ "link_fieldname": "party" } ], - "modified": "2026-02-08 20:28:01.101808", + "modified": "2026-02-08 21:28:01.101808", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", From 9a2eb91eec67e8cda610f25a341a841068f4ee5e Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 23 Feb 2026 11:24:13 +0530 Subject: [PATCH 3/4] fix: supplier_type appears multiple times --- erpnext/buying/doctype/supplier/supplier.json | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 37fabcf2607..c020779b3d7 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -11,7 +11,6 @@ "engine": "InnoDB", "field_order": [ "naming_series", - "supplier_type", "supplier_name", "gender", "column_break0", From 8cd12e37cd19e455d20e22bbf892eecd51eaccfb Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 23 Feb 2026 11:26:31 +0530 Subject: [PATCH 4/4] chore: fix conflicts --- erpnext/buying/doctype/supplier/supplier.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index c020779b3d7..94b3c8fe952 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -11,12 +11,12 @@ "engine": "InnoDB", "field_order": [ "naming_series", + "supplier_type", "supplier_name", "gender", "column_break0", "supplier_group", "country", - "supplier_type", "is_transporter", "image", "defaults_section",