diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index beb63cbde..b650301e2 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -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: diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index e81cc5664..bdf0885f4 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -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)