Merge pull request #52868 from frappe/mergify/bp/version-16-hotfix/pr-52534

refactor: supplier form cleanup (backport #52534)
This commit is contained in:
rohitwaghchaure
2026-02-23 12:12:57 +05:30
committed by GitHub
3 changed files with 43 additions and 29 deletions

View File

@@ -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")

View File

@@ -11,11 +11,12 @@
"engine": "InnoDB",
"field_order": [
"naming_series",
"supplier_type",
"supplier_name",
"country",
"gender",
"column_break0",
"supplier_group",
"supplier_type",
"country",
"is_transporter",
"image",
"defaults_section",
@@ -23,24 +24,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 +43,32 @@
"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",
"disabled",
"rfq_and_purchase_order_settings_section",
"warn_rfqs",
"warn_pos",
"prevent_rfqs",
"column_break_oxjw",
"warn_pos",
"prevent_pos",
"block_supplier_section",
"on_hold",
@@ -75,7 +77,7 @@
"release_date",
"portal_users_tab",
"portal_users",
"column_break_1mqv"
"dashboard_tab"
],
"fields": [
{
@@ -398,7 +400,7 @@
{
"fieldname": "dashboard_tab",
"fieldtype": "Tab Break",
"label": "Dashboard",
"label": "Connections",
"show_dashboard": 1
},
{
@@ -430,7 +432,7 @@
"collapsible": 1,
"fieldname": "internal_supplier_section",
"fieldtype": "Section Break",
"label": "Internal Supplier"
"label": "Internal Supplier Accounting"
},
{
"fieldname": "column_break_16",
@@ -488,6 +490,22 @@
"fieldtype": "Link",
"label": "Tax Withholding Group",
"options": "Tax Withholding Group"
},
{
"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"
}
],
"grid_page_length": 50,
@@ -501,7 +519,7 @@
"link_fieldname": "party"
}
],
"modified": "2026-02-06 12:58:01.398824",
"modified": "2026-02-08 21:28:01.101808",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",

View File

@@ -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 = ""