Skip to content

Commit

Permalink
fix: db set instead of lead.save
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Dec 30, 2024
1 parent 9a7913b commit 4b51801
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crm/fcrm/doctype/crm_deal/crm_deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def assign_agent(self, agent):
# 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:
Expand Down
7 changes: 3 additions & 4 deletions crm/fcrm/doctype/crm_lead/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b51801

Please sign in to comment.