Skip to content

Commit ff34601

Browse files
authored
Merge pull request #252 from frappe/develop
chore: Merge develop to main
2 parents eff4015 + 11e6615 commit ff34601

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

crm/fcrm/doctype/crm_deal/crm_deal.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,11 @@ def create_deal(args):
298298
deal.update({
299299
"organization": args.get("organization") or create_organization(args),
300300
"contacts": [{"contact": contact, "is_primary": 1}] if contact else [],
301-
"deal_owner": args.get("deal_owner"),
302-
"status": args.get("status"),
303301
})
302+
303+
args.pop("organization", None)
304+
305+
deal.update(args)
306+
304307
deal.insert(ignore_permissions=True)
305308
return deal.name

crm/fcrm/doctype/crm_lead/crm_lead.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ def convert_to_deal(lead, doc=None):
339339
frappe.throw(_("Not allowed to convert Lead to Deal"), frappe.PermissionError)
340340

341341
lead = frappe.get_cached_doc("CRM Lead", lead)
342-
lead.status = "Qualified"
342+
if frappe.db.exists("CRM Lead Status", "Qualified"):
343+
lead.status = "Qualified"
343344
lead.converted = 1
344-
if lead.sla:
345-
lead.communication_status = 'Replied'
345+
if lead.sla and frappe.db.exists("CRM Communication Status", "Replied"):
346+
lead.communication_status = "Replied"
346347
lead.save(ignore_permissions=True)
347348
contact = lead.create_contact(False)
348349
organization = lead.create_organization()

0 commit comments

Comments
 (0)