Merge pull request #55341 from khushi8112/customer-master-from-cleanup

fix: customer master form cleanup
This commit is contained in:
Khushi Rawat
2026-05-29 16:29:06 +05:30
committed by GitHub
4 changed files with 126 additions and 81 deletions

View File

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

View File

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

View File

@@ -12,18 +12,23 @@
"field_order": [ "field_order": [
"basic_info", "basic_info",
"naming_series", "naming_series",
"customer_type",
"customer_name", "customer_name",
"customer_type",
"gender", "gender",
"column_break0", "column_break0",
"customer_group", "customer_group",
"territory", "territory",
"image", "image",
"defaults_tab", "section_break_hwkr",
"default_currency", "default_currency",
"default_bank_account", "default_bank_account",
"column_break_14", "column_break_yvyu",
"default_price_list", "default_price_list",
"payment_terms",
"loyalty_points_tab",
"loyalty_program",
"column_break_54",
"loyalty_program_tier",
"contact_and_address_tab", "contact_and_address_tab",
"address_contacts", "address_contacts",
"address_html", "address_html",
@@ -39,28 +44,31 @@
"email_id", "email_id",
"first_name", "first_name",
"last_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", "tax_tab",
"taxation_section", "taxation_section",
"tax_id", "tax_id",
"tax_category", "tax_category",
"column_break_21", "column_break_21",
"tax_withholding_category",
"tax_withholding_group", "tax_withholding_group",
"accounting_tab", "tax_withholding_category",
"default_receivable_accounts", "settings_tab",
"accounts", "so_required",
"credit_limit_section", "dn_required",
"payment_terms", "column_break_53",
"credit_limits", "disabled",
"internal_customer_section", "is_frozen",
"is_internal_customer",
"represents_company",
"column_break_70",
"companies",
"loyalty_points_tab",
"loyalty_program",
"column_break_54",
"loyalty_program_tier",
"sales_team_tab", "sales_team_tab",
"account_manager", "account_manager",
"sales_team", "sales_team",
@@ -68,12 +76,6 @@
"default_sales_partner", "default_sales_partner",
"column_break_66", "column_break_66",
"default_commission_rate", "default_commission_rate",
"settings_tab",
"so_required",
"dn_required",
"column_break_53",
"disabled",
"is_frozen",
"portal_users_tab", "portal_users_tab",
"portal_users", "portal_users",
"more_info_tab", "more_info_tab",
@@ -91,6 +93,7 @@
"column_break_hdmn", "column_break_hdmn",
"customer_details", "customer_details",
"supplier_numbers_section", "supplier_numbers_section",
"supplier_numbers_column",
"supplier_numbers", "supplier_numbers",
"connections_tab" "connections_tab"
], ],
@@ -132,6 +135,7 @@
"default": "Company", "default": "Company",
"fieldname": "customer_type", "fieldname": "customer_type",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Customer Type", "label": "Customer Type",
"oldfieldname": "customer_type", "oldfieldname": "customer_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
@@ -139,10 +143,12 @@
"reqd": 1 "reqd": 1
}, },
{ {
"description": "Pre-filled on payment entries for this customer. Must be a company account.",
"fieldname": "default_bank_account", "fieldname": "default_bank_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Company Bank Account", "label": "Company Bank Account",
"options": "Bank Account" "options": "Bank Account",
"show_description_on_click": 1
}, },
{ {
"fieldname": "lead_name", "fieldname": "lead_name",
@@ -203,6 +209,7 @@
"label": "Tax ID" "label": "Tax ID"
}, },
{ {
"description": "Controls which tax template is auto-applied when this customer is selected on a transaction.",
"fieldname": "tax_category", "fieldname": "tax_category",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Tax Category", "label": "Tax Category",
@@ -210,12 +217,15 @@
}, },
{ {
"default": "0", "default": "0",
"description": "Blocks this customer from being used on any new transaction.",
"fieldname": "disabled", "fieldname": "disabled",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Disabled" "label": "Disabled",
"show_description_on_click": 1
}, },
{ {
"default": "0", "default": "0",
"description": "Mark if this customer represents an internal company. Enables inter-company transactions.",
"fieldname": "is_internal_customer", "fieldname": "is_internal_customer",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Internal Customer" "label": "Is Internal Customer"
@@ -230,31 +240,32 @@
"unique": 1 "unique": 1
}, },
{ {
"depends_on": "represents_company", "depends_on": "eval: doc.is_internal_customer && doc.represents_company",
"fieldname": "companies", "fieldname": "companies",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Allowed To Transact With", "label": "Allowed to transact with",
"options": "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", "fieldname": "default_currency",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Billing Currency", "label": "Billing Currency",
"no_copy": 1, "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", "fieldname": "default_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Price List", "label": "Price List",
"options": "Price List" "link_filters": "[[\"Price List\", \"selling\", \"=\", 1]]",
}, "options": "Price List",
{ "show_description_on_click": 1
"fieldname": "column_break_14",
"fieldtype": "Column Break"
}, },
{ {
"fieldname": "language", "fieldname": "language",
@@ -340,29 +351,30 @@
}, },
{ {
"fieldname": "default_receivable_accounts", "fieldname": "default_receivable_accounts",
"fieldtype": "Section Break", "fieldtype": "Section Break"
"label": "Default Accounts"
}, },
{ {
"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", "fieldname": "accounts",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Accounts", "label": "Default Accounts",
"options": "Party Account" "options": "Party Account",
"show_description_on_click": 1
}, },
{ {
"fieldname": "credit_limit_section", "fieldname": "credit_limit_section",
"fieldtype": "Section Break", "fieldtype": "Section Break"
"label": "Credit Limit and Payment Terms"
}, },
{ {
"description": "Defines when payment is due (e.g. Net 30, 50% advance). Applied automatically on invoices for this customer.",
"fieldname": "payment_terms", "fieldname": "payment_terms",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Payment Terms Template", "label": "Payment Terms Template",
"options": "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", "fieldname": "customer_details",
"fieldtype": "Text", "fieldtype": "Text",
"label": "Customer Details", "label": "Customer Details",
@@ -370,10 +382,12 @@
"oldfieldtype": "Code" "oldfieldtype": "Code"
}, },
{ {
"description": "Classify the type of market this customer belongs to, used for sales analysis and targeting.",
"fieldname": "market_segment", "fieldname": "market_segment",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Market Segment", "label": "Market Segment",
"options": "Market Segment" "options": "Market Segment",
"show_description_on_click": 1
}, },
{ {
"fieldname": "industry", "fieldname": "industry",
@@ -383,11 +397,14 @@
}, },
{ {
"default": "0", "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", "fieldname": "is_frozen",
"fieldtype": "Check", "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", "fieldname": "loyalty_program",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Loyalty Program", "label": "Loyalty Program",
@@ -395,6 +412,7 @@
"options": "Loyalty Program" "options": "Loyalty Program"
}, },
{ {
"description": "Current tier based on accumulated points. Updated automatically on each invoice.",
"fieldname": "loyalty_program_tier", "fieldname": "loyalty_program_tier",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Loyalty Program Tier", "label": "Loyalty Program Tier",
@@ -418,12 +436,14 @@
"oldfieldtype": "Currency" "oldfieldtype": "Currency"
}, },
{ {
"collapsible": 1,
"collapsible_depends_on": "sales_team", "collapsible_depends_on": "sales_team",
"description": "Commission paid to the Sales Partner on transactions with this customer.",
"fieldname": "sales_team_section", "fieldname": "sales_team_section",
"fieldtype": "Section Break" "fieldtype": "Section Break",
"label": "Sales Partner"
}, },
{ {
"description": "Split commission credit across multiple sales persons.",
"fieldname": "sales_team", "fieldname": "sales_team",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Sales Team", "label": "Sales Team",
@@ -441,24 +461,27 @@
"report_hide": 1 "report_hide": 1
}, },
{ {
"description": "Transactions are blocked or warned when outstanding balance exceeds this amount.",
"fieldname": "credit_limits", "fieldname": "credit_limits",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Credit Limit", "label": "Credit Limit",
"options": "Customer Credit Limit" "options": "Customer Credit Limit",
"show_description_on_click": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "so_required", "fieldname": "so_required",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Sales Invoice Creation Without Sales Order" "label": "Allow sales invoice creation without sales order"
}, },
{ {
"default": "0", "default": "0",
"fieldname": "dn_required", "fieldname": "dn_required",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Sales Invoice Creation Without Delivery Note" "label": "Allow sales invoice creation without delivery note"
}, },
{ {
"description": "TDS/TCS is calculated at the rate defined here on every payment from this customer.",
"fieldname": "tax_withholding_category", "fieldname": "tax_withholding_category",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Tax Withholding Category", "label": "Tax Withholding Category",
@@ -478,11 +501,6 @@
"fieldtype": "Tab Break", "fieldtype": "Tab Break",
"label": "Address & Contact" "label": "Address & Contact"
}, },
{
"fieldname": "defaults_tab",
"fieldtype": "Section Break",
"label": "Defaults"
},
{ {
"fieldname": "settings_tab", "fieldname": "settings_tab",
"fieldtype": "Tab Break", "fieldtype": "Tab Break",
@@ -511,6 +529,7 @@
}, },
{ {
"collapsible": 1, "collapsible": 1,
"collapsible_depends_on": "loyalty_program",
"fieldname": "loyalty_points_tab", "fieldname": "loyalty_points_tab",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Loyalty Points" "label": "Loyalty Points"
@@ -530,21 +549,17 @@
"label": "Tax" "label": "Tax"
}, },
{ {
"collapsible": 1,
"collapsible_depends_on": "is_internal_customer",
"fieldname": "internal_customer_section", "fieldname": "internal_customer_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hide_border": 1,
"label": "Internal Customer Accounting" "label": "Internal Customer Accounting"
}, },
{
"fieldname": "column_break_70",
"fieldtype": "Column Break"
},
{ {
"fieldname": "column_break_54", "fieldname": "column_break_54",
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"description": "Users listed here can log into the customer portal to view their orders, invoices, and deliveries.",
"fieldname": "portal_users_tab", "fieldname": "portal_users_tab",
"fieldtype": "Tab Break", "fieldtype": "Tab Break",
"label": "Portal Users" "label": "Portal Users"
@@ -583,13 +598,14 @@
"label": "Last Name" "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", "fieldname": "supplier_numbers",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Supplier Numbers", "label": "Supplier Numbers",
"options": "Supplier Number At Customer" "options": "Supplier Number At Customer"
}, },
{ {
"description": "Select the group first to filter the applicable withholding categories below.",
"fieldname": "tax_withholding_group", "fieldname": "tax_withholding_group",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Tax Withholding Group", "label": "Tax Withholding Group",
@@ -625,8 +641,32 @@
}, },
{ {
"fieldname": "supplier_numbers_section", "fieldname": "supplier_numbers_section",
"fieldtype": "Section Break"
},
{
"fieldname": "section_break_hwkr",
"fieldtype": "Section Break", "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", "icon": "fa fa-user",
@@ -640,7 +680,7 @@
"link_fieldname": "party" "link_fieldname": "party"
} }
], ],
"modified": "2026-03-09 17:15:26.040050", "modified": "2026-05-29 02:21:41.089319",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Customer", "name": "Customer",

View File

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