From 70584ac35f8cd41fed7bd7fb8fa27d79b2325d24 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:31:31 +0530 Subject: [PATCH] fix: added default communication statuses on install and changed lead status Open to New --- crm/install.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crm/install.py b/crm/install.py index 77979f73..51468333 100644 --- a/crm/install.py +++ b/crm/install.py @@ -10,11 +10,12 @@ def before_install(): def after_install(): add_default_lead_statuses() add_default_deal_statuses() + add_default_communication_statuses() frappe.db.commit() def add_default_lead_statuses(): statuses = { - "Open": { + "New": { "color": "gray", "position": 1, }, @@ -90,4 +91,15 @@ def add_default_deal_statuses(): doc.deal_status = status doc.color = statuses[status]["color"] doc.position = statuses[status]["position"] - doc.insert() \ No newline at end of file + doc.insert() + +def add_default_communication_statuses(): + statuses = ["Open", "Replied"] + + for status in statuses: + if frappe.db.exists("CRM Communication Status", status): + continue + + doc = frappe.new_doc("CRM Communication Status") + doc.status = status + doc.insert()