fix: removed mandatory property for address field in quick entry
diff --git a/erpnext/public/js/utils/customer_quick_entry.js b/erpnext/public/js/utils/customer_quick_entry.js
index ac9a782..ebe6cd9 100644
--- a/erpnext/public/js/utils/customer_quick_entry.js
+++ b/erpnext/public/js/utils/customer_quick_entry.js
@@ -2,6 +2,7 @@
frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
init: function(doctype, after_insert) {
+ this.skip_redirect_on_error = true;
this._super(doctype, after_insert);
},
@@ -37,8 +38,7 @@
{
label: __("Address Line 1"),
fieldname: "address_line1",
- fieldtype: "Data",
- reqd: 1
+ fieldtype: "Data"
},
{
label: __("Address Line 2"),
@@ -56,8 +56,7 @@
{
label: __("City"),
fieldname: "city",
- fieldtype: "Data",
- reqd: 1,
+ fieldtype: "Data"
},
{
label: __("State"),
@@ -68,8 +67,7 @@
label: __("Country"),
fieldname: "country",
fieldtype: "Link",
- options: "Country",
- reqd: 1
+ options: "Country"
},
{
label: __("Customer POS Id"),
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 4ca5af5..d49b9a9 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -357,6 +357,16 @@
return contact
def make_address(args, is_primary_address=1):
+ reqd_fields = []
+ for field in ['city', 'country']:
+ if not args.get(field):
+ reqd_fields.append( '<li>' + field.title() + '</li>')
+
+ if reqd_fields:
+ msg = _("Following fields are mandatory to create address:")
+ frappe.throw("{0} <br><br> <ul>{1}</ul>".format(msg, '\n'.join(reqd_fields)),
+ title = _("Missing Values Required"))
+
address = frappe.get_doc({
'doctype': 'Address',
'address_title': args.get('name'),