From 909d0490a26ad8789da0afe963088f44dc4ac4ff Mon Sep 17 00:00:00 2001 From: Neha Fathima Date: Thu, 5 Mar 2026 13:10:40 +0530 Subject: [PATCH] feat: Added New Fields In customer popup --- rmax_custom/api/customer.py | 12 ++++++--- rmax_custom/public/js/create_customer.js | 33 ++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/rmax_custom/api/customer.py b/rmax_custom/api/customer.py index 9e85cbc..ce75d4e 100644 --- a/rmax_custom/api/customer.py +++ b/rmax_custom/api/customer.py @@ -23,15 +23,18 @@ def create_customer_with_address( country=None, default_currency=None, tax_id=None, + custom_vat_registration_number=None, commercial_registration_number=None, address_type=None, address_line1=None, address_line2=None, - building_number=None, + custom_building_number=None, city=None, state=None, pincode=None, - district=None + custom_area=None, + + ): if not customer_name: @@ -68,7 +71,8 @@ def create_customer_with_address( "default_currency": default_currency, "tax_id": tax_id, "mobile_no": mobile_no, - "email_id": email_id + "email_id": email_id, + "custom_vat_registration_number": custom_vat_registration_number, }) customer.insert(ignore_permissions=True) @@ -83,6 +87,8 @@ def create_customer_with_address( "address_line2": address_line2, "city": city, "state": state, + "custom_area": custom_area, + "custom_building_number": custom_building_number, "pincode": pincode, "country": country, "is_primary_address": 1, diff --git a/rmax_custom/public/js/create_customer.js b/rmax_custom/public/js/create_customer.js index 8f0846a..94c6a18 100644 --- a/rmax_custom/public/js/create_customer.js +++ b/rmax_custom/public/js/create_customer.js @@ -44,6 +44,8 @@ function open_create_customer_dialog(frm) { let d = new frappe.ui.Dialog({ title: "Create New Customer", + size: "large", // important when many fields + fields: [ { fieldname: "customer_name", @@ -62,6 +64,11 @@ function open_create_customer_dialog(frm) { fieldtype: "Data", label: "Email ID" }, + { + fieldname: "custom_vat_registration_number", + fieldtype: "Data", + label: "VAT Registration Number" + }, { fieldtype: "Section Break", label: "Address Details" }, { fieldname: "address_type", @@ -82,6 +89,18 @@ function open_create_customer_dialog(frm) { fieldtype: "Data", label: "Address Line 2" }, + { + fieldname: "custom_building_number", + fieldtype: "Data", + label: "Building Number", + reqd: 1 + }, + { + fieldname: "custom_area", + fieldtype: "Data", + label: "Area/District", + reqd: 1 + }, { fieldname: "city", fieldtype: "Data", @@ -96,7 +115,12 @@ function open_create_customer_dialog(frm) { default: country, reqd: 1 }, - + { + fieldname: "pincode", + fieldtype: "Data", + label: "Postal Code", + reqd: 1 + }, ], primary_action_label: "Create Customer", @@ -111,6 +135,10 @@ function open_create_customer_dialog(frm) { address_type: values.address_type, address_line1: values.address_line1, address_line2: values.address_line2 || null, + custom_vat_registration_number: values.custom_vat_registration_number || null, + custom_building_number: values.custom_building_number, + custom_area: values.custom_area, + pincode: values.pincode, city: values.city, country: values.country, default_currency: default_currency @@ -135,4 +163,5 @@ function open_create_customer_dialog(frm) { d.show(); }); -} \ No newline at end of file +} +