mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
fix: conditionally set lead title as organization or person
This commit is contained in:
@@ -54,7 +54,8 @@
|
|||||||
"website",
|
"website",
|
||||||
"territory",
|
"territory",
|
||||||
"unsubscribed",
|
"unsubscribed",
|
||||||
"blog_subscriber"
|
"blog_subscriber",
|
||||||
|
"title"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -409,6 +410,13 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Postal Code",
|
"label": "Postal Code",
|
||||||
"options": "Country"
|
"options": "Country"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "title",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Title",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
@@ -477,5 +485,5 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"title_field": "lead_name"
|
"title_field": "title"
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,7 @@ class Lead(SellingController):
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_lead_name()
|
self.set_lead_name()
|
||||||
|
self.set_title()
|
||||||
self._prev = frappe._dict({
|
self._prev = frappe._dict({
|
||||||
"contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if (not cint(self.is_new())) else None,
|
"contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if (not cint(self.is_new())) else None,
|
||||||
"ends_on": frappe.db.get_value("Lead", self.name, "ends_on") if (not cint(self.is_new())) else None,
|
"ends_on": frappe.db.get_value("Lead", self.name, "ends_on") if (not cint(self.is_new())) else None,
|
||||||
@@ -120,6 +121,12 @@ class Lead(SellingController):
|
|||||||
|
|
||||||
self.lead_name = self.company_name
|
self.lead_name = self.company_name
|
||||||
|
|
||||||
|
def set_title(self):
|
||||||
|
if self.organization_lead:
|
||||||
|
self.title = self.company_name
|
||||||
|
else:
|
||||||
|
self.title = self.lead_name
|
||||||
|
|
||||||
def create_address(self):
|
def create_address(self):
|
||||||
address_fields = ["address_title", "address_line1", "address_line2",
|
address_fields = ["address_title", "address_line1", "address_line2",
|
||||||
"city", "county", "state", "country", "pincode"]
|
"city", "county", "state", "country", "pincode"]
|
||||||
|
|||||||
Reference in New Issue
Block a user