fix: removed mandatory property for address field in quick entry
This commit is contained in:
parent
780fb8a4e5
commit
1f9a84f165
@ -2,6 +2,7 @@ frappe.provide('frappe.ui.form');
|
|||||||
|
|
||||||
frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
||||||
init: function(doctype, after_insert) {
|
init: function(doctype, after_insert) {
|
||||||
|
this.skip_redirect_on_error = true;
|
||||||
this._super(doctype, after_insert);
|
this._super(doctype, after_insert);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -37,8 +38,7 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
{
|
{
|
||||||
label: __("Address Line 1"),
|
label: __("Address Line 1"),
|
||||||
fieldname: "address_line1",
|
fieldname: "address_line1",
|
||||||
fieldtype: "Data",
|
fieldtype: "Data"
|
||||||
reqd: 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("Address Line 2"),
|
label: __("Address Line 2"),
|
||||||
@ -56,8 +56,7 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
{
|
{
|
||||||
label: __("City"),
|
label: __("City"),
|
||||||
fieldname: "city",
|
fieldname: "city",
|
||||||
fieldtype: "Data",
|
fieldtype: "Data"
|
||||||
reqd: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("State"),
|
label: __("State"),
|
||||||
@ -68,8 +67,7 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
label: __("Country"),
|
label: __("Country"),
|
||||||
fieldname: "country",
|
fieldname: "country",
|
||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
options: "Country",
|
options: "Country"
|
||||||
reqd: 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("Customer POS Id"),
|
label: __("Customer POS Id"),
|
||||||
|
@ -357,6 +357,16 @@ def make_contact(args, is_primary_contact=1):
|
|||||||
return contact
|
return contact
|
||||||
|
|
||||||
def make_address(args, is_primary_address=1):
|
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({
|
address = frappe.get_doc({
|
||||||
'doctype': 'Address',
|
'doctype': 'Address',
|
||||||
'address_title': args.get('name'),
|
'address_title': args.get('name'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user