mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
Merge pull request #52534 from rohitwaghchaure/form-cleanup-supplier-form
refactor: supplier form cleanup
This commit is contained in:
@@ -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) {
|
refresh: function (frm) {
|
||||||
if (frappe.defaults.get_default("supp_master_name") != "Naming Series") {
|
if (frappe.defaults.get_default("supp_master_name") != "Naming Series") {
|
||||||
frm.toggle_display("naming_series", false);
|
frm.toggle_display("naming_series", false);
|
||||||
@@ -111,14 +117,6 @@ frappe.ui.form.on("Supplier", {
|
|||||||
__("View")
|
__("View")
|
||||||
);
|
);
|
||||||
|
|
||||||
frm.add_custom_button(
|
|
||||||
__("Get Supplier Group Details"),
|
|
||||||
function () {
|
|
||||||
frm.trigger("get_supplier_group_details");
|
|
||||||
},
|
|
||||||
__("Actions")
|
|
||||||
);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
cint(frappe.defaults.get_default("enable_common_party_accounting")) &&
|
cint(frappe.defaults.get_default("enable_common_party_accounting")) &&
|
||||||
frappe.model.can_create("Party Link")
|
frappe.model.can_create("Party Link")
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"naming_series",
|
"naming_series",
|
||||||
"supplier_name",
|
|
||||||
"supplier_type",
|
"supplier_type",
|
||||||
|
"supplier_name",
|
||||||
"gender",
|
"gender",
|
||||||
"column_break0",
|
"column_break0",
|
||||||
"supplier_group",
|
"supplier_group",
|
||||||
@@ -24,24 +24,12 @@
|
|||||||
"default_bank_account",
|
"default_bank_account",
|
||||||
"column_break_10",
|
"column_break_10",
|
||||||
"default_price_list",
|
"default_price_list",
|
||||||
"internal_supplier_section",
|
|
||||||
"is_internal_supplier",
|
|
||||||
"represents_company",
|
|
||||||
"column_break_16",
|
|
||||||
"companies",
|
|
||||||
"column_break2",
|
"column_break2",
|
||||||
"supplier_details",
|
"supplier_details",
|
||||||
"column_break_30",
|
"column_break_30",
|
||||||
"website",
|
"website",
|
||||||
"language",
|
"language",
|
||||||
"customer_numbers",
|
"customer_numbers",
|
||||||
"dashboard_tab",
|
|
||||||
"tax_tab",
|
|
||||||
"tax_id",
|
|
||||||
"tax_category",
|
|
||||||
"column_break_27",
|
|
||||||
"tax_withholding_category",
|
|
||||||
"tax_withholding_group",
|
|
||||||
"contact_and_address_tab",
|
"contact_and_address_tab",
|
||||||
"address_contacts",
|
"address_contacts",
|
||||||
"address_html",
|
"address_html",
|
||||||
@@ -55,19 +43,32 @@
|
|||||||
"supplier_primary_contact",
|
"supplier_primary_contact",
|
||||||
"mobile_no",
|
"mobile_no",
|
||||||
"email_id",
|
"email_id",
|
||||||
|
"tax_tab",
|
||||||
|
"tax_id",
|
||||||
|
"tax_category",
|
||||||
|
"column_break_27",
|
||||||
|
"tax_withholding_category",
|
||||||
|
"tax_withholding_group",
|
||||||
"accounting_tab",
|
"accounting_tab",
|
||||||
"payment_terms",
|
"payment_terms",
|
||||||
"default_accounts_section",
|
"default_accounts_section",
|
||||||
"accounts",
|
"accounts",
|
||||||
|
"internal_supplier_section",
|
||||||
|
"is_internal_supplier",
|
||||||
|
"represents_company",
|
||||||
|
"column_break_16",
|
||||||
|
"companies",
|
||||||
"settings_tab",
|
"settings_tab",
|
||||||
"allow_purchase_invoice_creation_without_purchase_order",
|
"allow_purchase_invoice_creation_without_purchase_order",
|
||||||
"allow_purchase_invoice_creation_without_purchase_receipt",
|
"allow_purchase_invoice_creation_without_purchase_receipt",
|
||||||
"column_break_54",
|
"column_break_54",
|
||||||
"disabled",
|
"disabled",
|
||||||
"is_frozen",
|
"is_frozen",
|
||||||
|
"rfq_and_purchase_order_settings_section",
|
||||||
"warn_rfqs",
|
"warn_rfqs",
|
||||||
"warn_pos",
|
|
||||||
"prevent_rfqs",
|
"prevent_rfqs",
|
||||||
|
"column_break_oxjw",
|
||||||
|
"warn_pos",
|
||||||
"prevent_pos",
|
"prevent_pos",
|
||||||
"block_supplier_section",
|
"block_supplier_section",
|
||||||
"on_hold",
|
"on_hold",
|
||||||
@@ -75,7 +76,8 @@
|
|||||||
"column_break_59",
|
"column_break_59",
|
||||||
"release_date",
|
"release_date",
|
||||||
"portal_users_tab",
|
"portal_users_tab",
|
||||||
"portal_users"
|
"portal_users",
|
||||||
|
"dashboard_tab"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -398,7 +400,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "dashboard_tab",
|
"fieldname": "dashboard_tab",
|
||||||
"fieldtype": "Tab Break",
|
"fieldtype": "Tab Break",
|
||||||
"label": "Dashboard",
|
"label": "Connections",
|
||||||
"show_dashboard": 1
|
"show_dashboard": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -430,7 +432,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"fieldname": "internal_supplier_section",
|
"fieldname": "internal_supplier_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Internal Supplier"
|
"label": "Internal Supplier Accounting"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_16",
|
"fieldname": "column_break_16",
|
||||||
@@ -491,6 +493,15 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Gender",
|
"label": "Gender",
|
||||||
"options": "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,
|
"grid_page_length": 50,
|
||||||
@@ -504,7 +515,7 @@
|
|||||||
"link_fieldname": "party"
|
"link_fieldname": "party"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2026-02-06 12:58:01.398824",
|
"modified": "2026-02-08 20:28:01.101808",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Supplier",
|
"name": "Supplier",
|
||||||
|
|||||||
@@ -162,8 +162,6 @@ class Supplier(TransactionBase):
|
|||||||
if doc.payment_terms:
|
if doc.payment_terms:
|
||||||
self.payment_terms = doc.payment_terms
|
self.payment_terms = doc.payment_terms
|
||||||
|
|
||||||
self.save()
|
|
||||||
|
|
||||||
def validate_internal_supplier(self):
|
def validate_internal_supplier(self):
|
||||||
if not self.is_internal_supplier:
|
if not self.is_internal_supplier:
|
||||||
self.represents_company = ""
|
self.represents_company = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user