Merge pull request #252 from frappe/develop

chore: Merge develop to main
This commit is contained in:
Shariq Ansari 2024-07-10 12:27:34 +05:30 committed by GitHub
commit ff3460171e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -298,8 +298,11 @@ def create_deal(args):
deal.update({
"organization": args.get("organization") or create_organization(args),
"contacts": [{"contact": contact, "is_primary": 1}] if contact else [],
"deal_owner": args.get("deal_owner"),
"status": args.get("status"),
})
args.pop("organization", None)
deal.update(args)
deal.insert(ignore_permissions=True)
return deal.name

View File

@ -339,10 +339,11 @@ def convert_to_deal(lead, doc=None):
frappe.throw(_("Not allowed to convert Lead to Deal"), frappe.PermissionError)
lead = frappe.get_cached_doc("CRM Lead", lead)
lead.status = "Qualified"
if frappe.db.exists("CRM Lead Status", "Qualified"):
lead.status = "Qualified"
lead.converted = 1
if lead.sla:
lead.communication_status = 'Replied'
if lead.sla and frappe.db.exists("CRM Communication Status", "Replied"):
lead.communication_status = "Replied"
lead.save(ignore_permissions=True)
contact = lead.create_contact(False)
organization = lead.create_organization()