fix: db set instead of lead.save
This commit is contained in:
parent
9a7913bb43
commit
4b51801f75
@ -80,7 +80,7 @@ class CRMDeal(Document):
|
|||||||
# the agent is already set as an assignee
|
# the agent is already set as an assignee
|
||||||
return
|
return
|
||||||
|
|
||||||
assign({"assign_to": [agent], "doctype": "CRM Deal", "name": self.name})
|
assign({"assign_to": [agent], "doctype": "CRM Deal", "name": self.name}, ignore_permissions=True)
|
||||||
|
|
||||||
def share_with_agent(self, agent):
|
def share_with_agent(self, agent):
|
||||||
if not agent:
|
if not agent:
|
||||||
|
|||||||
@ -388,11 +388,10 @@ def convert_to_deal(lead, doc=None):
|
|||||||
|
|
||||||
lead = frappe.get_cached_doc("CRM Lead", lead)
|
lead = frappe.get_cached_doc("CRM Lead", lead)
|
||||||
if frappe.db.exists("CRM Lead Status", "Qualified"):
|
if frappe.db.exists("CRM Lead Status", "Qualified"):
|
||||||
lead.status = "Qualified"
|
lead.db_set("status", "Qualified")
|
||||||
lead.converted = 1
|
lead.db_set("converted", 1)
|
||||||
if lead.sla and frappe.db.exists("CRM Communication Status", "Replied"):
|
if lead.sla and frappe.db.exists("CRM Communication Status", "Replied"):
|
||||||
lead.communication_status = "Replied"
|
lead.db_set("communication_status", "Replied")
|
||||||
lead.save(ignore_permissions=True)
|
|
||||||
contact = lead.create_contact(False)
|
contact = lead.create_contact(False)
|
||||||
organization = lead.create_organization()
|
organization = lead.create_organization()
|
||||||
deal = lead.create_deal(contact, organization)
|
deal = lead.create_deal(contact, organization)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user