fix: customer master form cleanup

This commit is contained in:
khushi8112
2026-05-27 14:36:36 +05:30
parent e1ddc50872
commit 6f6e17188f
4 changed files with 126 additions and 84 deletions

View File

@@ -29,6 +29,7 @@
{
"fieldname": "advance_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Advance Account",
"options": "Account"
}
@@ -36,14 +37,15 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-03-27 13:10:08.489183",
"modified": "2026-05-27 14:19:00.888437",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Account",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -38,7 +38,7 @@ frappe.ui.form.on("Customer", {
frm.add_fetch("lead_name", "company_name", "customer_name");
frm.add_fetch("default_sales_partner", "commission_rate", "default_commission_rate");
frm.set_query("default_price_list", { selling: 1 });
frm.set_query("default_price_list", () => ({ filters: { selling: 1 } }));
frm.set_query("account", "accounts", function (doc, cdt, cdn) {
let d = locals[cdt][cdn];
let filters = {
@@ -185,13 +185,15 @@ frappe.ui.form.on("Customer", {
frm.add_custom_button(__(doctype), frm.make_methods[doctype], __("Create"));
}
frm.add_custom_button(
__("Get Customer Group Details"),
function () {
frm.trigger("get_customer_group_details");
},
__("Actions")
);
if (frm.doc.customer_group) {
frm.add_custom_button(
__("Get Customer Group Details"),
function () {
frm.trigger("get_customer_group_details");
},
__("Actions")
);
}
if (
cint(frappe.defaults.get_default("enable_common_party_accounting")) &&

View File

@@ -19,11 +19,16 @@
"customer_group",
"territory",
"image",
"defaults_tab",
"section_break_hwkr",
"default_currency",
"default_bank_account",
"column_break_14",
"column_break_yvyu",
"default_price_list",
"payment_terms",
"loyalty_points_tab",
"loyalty_program",
"column_break_54",
"loyalty_program_tier",
"contact_and_address_tab",
"address_contacts",
"address_html",
@@ -39,28 +44,31 @@
"email_id",
"first_name",
"last_name",
"accounting_tab",
"default_receivable_accounts",
"default_accounts_column",
"accounts",
"credit_limit_section",
"credit_limit_column",
"credit_limits",
"internal_customer_section",
"is_internal_customer",
"represents_company",
"section_break_nrvh",
"companies",
"tax_tab",
"taxation_section",
"tax_id",
"tax_category",
"column_break_21",
"tax_withholding_category",
"tax_withholding_group",
"accounting_tab",
"default_receivable_accounts",
"accounts",
"credit_limit_section",
"payment_terms",
"credit_limits",
"internal_customer_section",
"is_internal_customer",
"represents_company",
"column_break_70",
"companies",
"loyalty_points_tab",
"loyalty_program",
"column_break_54",
"loyalty_program_tier",
"tax_withholding_category",
"settings_tab",
"so_required",
"dn_required",
"column_break_53",
"disabled",
"is_frozen",
"sales_team_tab",
"account_manager",
"sales_team",
@@ -68,12 +76,6 @@
"default_sales_partner",
"column_break_66",
"default_commission_rate",
"settings_tab",
"so_required",
"dn_required",
"column_break_53",
"disabled",
"is_frozen",
"portal_users_tab",
"portal_users",
"more_info_tab",
@@ -91,6 +93,7 @@
"column_break_hdmn",
"customer_details",
"supplier_numbers_section",
"supplier_numbers_column",
"supplier_numbers",
"connections_tab"
],
@@ -139,10 +142,12 @@
"reqd": 1
},
{
"description": "Pre-filled on payment entries for this customer. Must be a company account.",
"fieldname": "default_bank_account",
"fieldtype": "Link",
"label": "Default Company Bank Account",
"options": "Bank Account"
"label": "Company Bank Account",
"options": "Bank Account",
"show_description_on_click": 1
},
{
"fieldname": "lead_name",
@@ -203,6 +208,7 @@
"label": "Tax ID"
},
{
"description": "Controls which tax template is auto-applied when this customer is selected on a transaction.",
"fieldname": "tax_category",
"fieldtype": "Link",
"label": "Tax Category",
@@ -210,12 +216,15 @@
},
{
"default": "0",
"description": "Blocks this customer from being used on any new transaction.",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
"label": "Disabled",
"show_description_on_click": 1
},
{
"default": "0",
"description": "Mark if this customer represents an internal company. Enables inter-company transactions.",
"fieldname": "is_internal_customer",
"fieldtype": "Check",
"label": "Is Internal Customer"
@@ -230,31 +239,32 @@
"unique": 1
},
{
"depends_on": "represents_company",
"depends_on": "eval: doc.is_internal_customer && doc.represents_company",
"fieldname": "companies",
"fieldtype": "Table",
"label": "Allowed To Transact With",
"label": "Allowed to transact with",
"options": "Allowed To Transact With"
},
{
"description": "All invoices and orders for this customer will be created in this currency.",
"fieldname": "default_currency",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"in_list_view": 1,
"label": "Billing Currency",
"no_copy": 1,
"options": "Currency"
"options": "Currency",
"show_description_on_click": 1
},
{
"description": "Fetched automatically on sales orders and invoices for this customer.",
"fieldname": "default_price_list",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Default Price List",
"options": "Price List"
},
{
"fieldname": "column_break_14",
"fieldtype": "Column Break"
"label": "Price List",
"link_filters": "[[\"Price List\", \"selling\", \"=\", 1]]",
"options": "Price List",
"show_description_on_click": 1
},
{
"fieldname": "language",
@@ -340,40 +350,43 @@
},
{
"fieldname": "default_receivable_accounts",
"fieldtype": "Section Break",
"label": "Default Accounts"
"fieldtype": "Section Break"
},
{
"description": "Mention if non-standard Receivable account",
"description": "If set, accounting entries for this customer will post to these accounts instead of the company default.",
"fieldname": "accounts",
"fieldtype": "Table",
"label": "Accounts",
"options": "Party Account"
"label": "Default Accounts",
"options": "Party Account",
"show_description_on_click": 1
},
{
"fieldname": "credit_limit_section",
"fieldtype": "Section Break",
"label": "Credit Limit and Payment Terms"
"fieldtype": "Section Break"
},
{
"description": "Defines when payment is due (e.g. Net 30, 50% advance). Applied automatically on invoices for this customer.",
"fieldname": "payment_terms",
"fieldtype": "Link",
"label": "Default Payment Terms Template",
"options": "Payment Terms Template"
"label": "Payment Terms Template",
"options": "Payment Terms Template",
"show_description_on_click": 1
},
{
"description": "Additional information regarding the customer.",
"description": "Internal notes about this customer. Not visible on transactions or the portal.",
"fieldname": "customer_details",
"fieldtype": "Text",
"label": "Customer Details",
"label": "Notes",
"oldfieldname": "customer_details",
"oldfieldtype": "Code"
},
{
"description": "Classify the type of market this customer belongs to, used for sales analysis and targeting.",
"fieldname": "market_segment",
"fieldtype": "Link",
"label": "Market Segment",
"options": "Market Segment"
"options": "Market Segment",
"show_description_on_click": 1
},
{
"fieldname": "industry",
@@ -383,11 +396,14 @@
},
{
"default": "0",
"description": "Blocks all further accounting entries on this customer's account. Only users with the frozen-entries role can override.\n",
"fieldname": "is_frozen",
"fieldtype": "Check",
"label": "Is Frozen"
"label": "Is Frozen",
"show_description_on_click": 1
},
{
"description": "Loyalty scheme this customer earns points under. Auto-assigned if a matching program exists.",
"fieldname": "loyalty_program",
"fieldtype": "Link",
"label": "Loyalty Program",
@@ -395,6 +411,7 @@
"options": "Loyalty Program"
},
{
"description": "Current tier based on accumulated points. Updated automatically on each invoice.",
"fieldname": "loyalty_program_tier",
"fieldtype": "Data",
"label": "Loyalty Program Tier",
@@ -418,12 +435,14 @@
"oldfieldtype": "Currency"
},
{
"collapsible": 1,
"collapsible_depends_on": "sales_team",
"description": "Commission paid to the Sales Partner on transactions with this customer.",
"fieldname": "sales_team_section",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Sales Partner"
},
{
"description": "Split commission credit across multiple sales persons.",
"fieldname": "sales_team",
"fieldtype": "Table",
"label": "Sales Team",
@@ -441,24 +460,28 @@
"report_hide": 1
},
{
"description": "Transactions are blocked or warned when outstanding balance exceeds this amount.",
"fieldname": "credit_limits",
"fieldtype": "Table",
"label": "Credit Limit",
"options": "Customer Credit Limit"
"options": "Customer Credit Limit",
"show_description_on_click": 1
},
{
"default": "0",
"fieldname": "so_required",
"fieldtype": "Check",
"label": "Allow Sales Invoice Creation Without Sales Order"
"label": "Allow sales invoice creation without sales order"
},
{
"default": "0",
"fieldname": "dn_required",
"fieldtype": "Check",
"label": "Allow Sales Invoice Creation Without Delivery Note"
"label": "Allow sales invoice creation without delivery note"
},
{
"depends_on": "tax_withholding_group",
"description": "TDS/TCS is calculated at the rate defined here on every payment from this customer.",
"fieldname": "tax_withholding_category",
"fieldtype": "Link",
"label": "Tax Withholding Category",
@@ -478,11 +501,6 @@
"fieldtype": "Tab Break",
"label": "Address & Contact"
},
{
"fieldname": "defaults_tab",
"fieldtype": "Section Break",
"label": "Defaults"
},
{
"fieldname": "settings_tab",
"fieldtype": "Tab Break",
@@ -510,10 +528,8 @@
"fieldtype": "Column Break"
},
{
"collapsible": 1,
"fieldname": "loyalty_points_tab",
"fieldtype": "Section Break",
"label": "Loyalty Points"
"fieldtype": "Section Break"
},
{
"fieldname": "taxation_section",
@@ -530,21 +546,17 @@
"label": "Tax"
},
{
"collapsible": 1,
"collapsible_depends_on": "is_internal_customer",
"fieldname": "internal_customer_section",
"fieldtype": "Section Break",
"hide_border": 1,
"label": "Internal Customer Accounting"
},
{
"fieldname": "column_break_70",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_54",
"fieldtype": "Column Break"
},
{
"description": "Users listed here can log into the customer portal to view their orders, invoices, and deliveries.",
"fieldname": "portal_users_tab",
"fieldtype": "Tab Break",
"label": "Portal Users"
@@ -583,13 +595,14 @@
"label": "Last Name"
},
{
"description": "Supplier numbers assigned by the customer",
"description": "Numbers this customer uses to identify your company in their own system.",
"fieldname": "supplier_numbers",
"fieldtype": "Table",
"label": "Supplier Numbers",
"options": "Supplier Number At Customer"
},
{
"description": "Select the group first to filter the applicable withholding categories below.",
"fieldname": "tax_withholding_group",
"fieldtype": "Link",
"label": "Tax Withholding Group",
@@ -625,8 +638,32 @@
},
{
"fieldname": "supplier_numbers_section",
"fieldtype": "Section Break"
},
{
"fieldname": "section_break_hwkr",
"fieldtype": "Section Break",
"label": "Supplier Numbers"
"label": "Defaults"
},
{
"fieldname": "column_break_yvyu",
"fieldtype": "Column Break"
},
{
"fieldname": "default_accounts_column",
"fieldtype": "Column Break"
},
{
"fieldname": "supplier_numbers_column",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_nrvh",
"fieldtype": "Section Break"
},
{
"fieldname": "credit_limit_column",
"fieldtype": "Column Break"
}
],
"icon": "fa fa-user",
@@ -640,7 +677,7 @@
"link_fieldname": "party"
}
],
"modified": "2026-03-09 17:15:26.040050",
"modified": "2026-05-27 17:07:25.099707",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",

View File

@@ -36,19 +36,20 @@
"fieldname": "bypass_credit_limit_check",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Bypass Credit Limit Check at Sales Order"
"label": "Bypass credit limit check at sales order"
}
],
"istable": 1,
"links": [],
"modified": "2024-03-27 13:06:48.432478",
"modified": "2026-05-27 00:26:50.904565",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer Credit Limit",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}