fix: Address section rearrange and minor bug fixes

This commit is contained in:
deepeshgarg007
2019-12-24 16:45:09 +05:30
parent e633567787
commit d7427919a4
2 changed files with 41 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
{ {
"actions": [],
"allow_events_in_timeline": 1, "allow_events_in_timeline": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
@@ -30,18 +31,19 @@
"ends_on", "ends_on",
"notes_section", "notes_section",
"notes", "notes",
"contact_info", "address_info",
"address_html", "address_html",
"address_title", "address_title",
"address_line1", "address_line1",
"address_line2", "address_line2",
"city", "city",
"county", "county",
"column_break2",
"contact_html",
"state", "state",
"country", "country",
"pincode", "pincode",
"column_break2", "contact_section",
"contact_html",
"phone", "phone",
"mobile_no", "mobile_no",
"fax", "fax",
@@ -230,15 +232,6 @@
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"label": "Notes" "label": "Notes"
}, },
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.__islocal",
"fieldname": "contact_info",
"fieldtype": "Section Break",
"label": "Address & Contact",
"oldfieldtype": "Column Break",
"options": "fa fa-map-marker"
},
{ {
"fieldname": "address_html", "fieldname": "address_html",
"fieldtype": "HTML", "fieldtype": "HTML",
@@ -424,12 +417,29 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Designation", "label": "Designation",
"options": "Designation" "options": "Designation"
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.__islocal",
"fieldname": "address_info",
"fieldtype": "Section Break",
"label": "Address & Contact",
"oldfieldtype": "Column Break",
"options": "fa fa-map-marker"
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.__islocal",
"fieldname": "contact_section",
"fieldtype": "Section Break",
"label": "Contact"
} }
], ],
"icon": "fa fa-user", "icon": "fa fa-user",
"idx": 5, "idx": 5,
"image_field": "image", "image_field": "image",
"modified": "2019-09-20 12:49:02.536647", "links": [],
"modified": "2019-12-24 16:00:44.239168",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "CRM", "module": "CRM",
"name": "Lead", "name": "Lead",

View File

@@ -161,22 +161,25 @@ class Lead(SellingController):
"salutation": self.salutation, "salutation": self.salutation,
"gender": self.gender, "gender": self.gender,
"designation": self.designation, "designation": self.designation,
"email_ids": [
{
"email_id": self.email_id,
"is_primary": 1
}
],
"phone_nos": [
{
"phone": self.phone,
"is_primary": 1
},
{
"phone": self.mobile_no,
}
]
}) })
if self.email_id:
contact.append("email_ids", {
"email_id": self.email_id,
"is_primary": 1
})
if self.phone:
contact.append("phone_nos", {
"phone": self.phone,
"is_primary": 1
})
if self.mobile_no:
contact.append("phone_nos", {
"phone": self.mobile_no
})
contact.insert() contact.insert()
return contact return contact