fix: db set instead of lead.save

This commit is contained in:
Shariq Ansari 2024-12-30 22:39:44 +05:30
parent 9a7913bb43
commit 4b51801f75
2 changed files with 4 additions and 5 deletions

View File

@ -80,7 +80,7 @@ class CRMDeal(Document):
# the agent is already set as an assignee
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):
if not agent:

View File

@ -388,11 +388,10 @@ def convert_to_deal(lead, doc=None):
lead = frappe.get_cached_doc("CRM Lead", lead)
if frappe.db.exists("CRM Lead Status", "Qualified"):
lead.status = "Qualified"
lead.converted = 1
lead.db_set("status", "Qualified")
lead.db_set("converted", 1)
if lead.sla and frappe.db.exists("CRM Communication Status", "Replied"):
lead.communication_status = "Replied"
lead.save(ignore_permissions=True)
lead.db_set("communication_status", "Replied")
contact = lead.create_contact(False)
organization = lead.create_organization()
deal = lead.create_deal(contact, organization)