fix: Mandatory field missing to create address from lead

This commit is contained in:
Kanchan Chauhan 2020-04-06 22:20:42 +05:30
parent 96dd2079f3
commit 4791e313db
2 changed files with 13 additions and 8 deletions

View File

@ -1,12 +1,10 @@
{ {
"actions": [],
"allow_events_in_timeline": 1, "allow_events_in_timeline": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-04-10 11:45:37", "creation": "2013-04-10 11:45:37",
"doctype": "DocType", "doctype": "DocType",
"document_type": "Document", "document_type": "Document",
"email_append_to": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"organization_lead", "organization_lead",
@ -34,6 +32,7 @@
"notes", "notes",
"address_info", "address_info",
"address_html", "address_html",
"address_type",
"address_title", "address_title",
"address_line1", "address_line1",
"address_line2", "address_line2",
@ -433,13 +432,20 @@
"fieldname": "contact_section", "fieldname": "contact_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Contact" "label": "Contact"
},
{
"default": "Billing",
"depends_on": "eval: doc.__islocal",
"fieldname": "address_type",
"fieldtype": "Select",
"label": "Address Type",
"options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nCurrent\nPermanent\nOther"
} }
], ],
"icon": "fa fa-user", "icon": "fa fa-user",
"idx": 5, "idx": 5,
"image_field": "image", "image_field": "image",
"links": [], "modified": "2020-04-06 20:26:11.687110",
"modified": "2020-01-13 16:16:48.885228",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "CRM", "module": "CRM",
"name": "Lead", "name": "Lead",
@ -508,7 +514,6 @@
} }
], ],
"search_fields": "lead_name,lead_owner,status", "search_fields": "lead_name,lead_owner,status",
"sender_field": "email_id",
"show_name_in_global_search": 1, "show_name_in_global_search": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",

View File

@ -126,7 +126,7 @@ class Lead(SellingController):
self.title = self.lead_name self.title = self.lead_name
def create_address(self): def create_address(self):
address_fields = ["address_title", "address_line1", "address_line2", address_fields = ["address_type", "address_title", "address_line1", "address_line2",
"city", "county", "state", "country", "pincode"] "city", "county", "state", "country", "pincode"]
info_fields = ["email_id", "phone", "fax"] info_fields = ["email_id", "phone", "fax"]
@ -209,7 +209,7 @@ class Lead(SellingController):
self.contact_doc.save() self.contact_doc.save()
def flush_address_and_contact_fields(self): def flush_address_and_contact_fields(self):
fields = ['address_line1', 'address_line2', 'address_title', fields = ['address_type', 'address_line1', 'address_line2', 'address_title',
'city', 'county', 'country', 'fax', 'pincode', 'state'] 'city', 'county', 'country', 'fax', 'pincode', 'state']
for field in fields: for field in fields: