Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge develop to main #252

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crm/fcrm/doctype/crm_deal/crm_deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions crm/fcrm/doctype/crm_lead/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading