From c345d5b5bd5f7fcc32dccfcb2789f4bc4a304ee6 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 23 Jul 2025 13:21:02 +0530 Subject: [PATCH] refactor: rename update_close_date to update_closed_date and adjust related logic (cherry picked from commit c84ac2933265889a599bd1cc8e57fb802fa2baea) --- crm/fcrm/doctype/crm_deal/crm_deal.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index f46f6475..bd4198a3 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -139,12 +139,12 @@ class CRMDeal(Document): if sla: sla.apply(self) - def update_close_date(self): + def update_closed_date(self): """ - Update the close date based on the "Won" status. + Update the closed date based on the "Won" status. """ - if self.status == "Won" and not self.close_date: - self.close_date = frappe.utils.nowdate() + if self.status == "Won" and not self.closed_date: + self.closed_date = frappe.utils.nowdate() def update_default_probability(self): """ @@ -154,13 +154,13 @@ class CRMDeal(Document): self.probability = frappe.db.get_value("CRM Deal Status", self.status, "probability") or 0 def validate_forcasting_fields(self): - self.update_close_date() + self.update_closed_date() self.update_default_probability() if frappe.db.get_single_value("FCRM Settings", "enable_forecasting"): - if not self.deal_value or self.deal_value == 0: - frappe.throw(_("Deal Value is required."), frappe.MandatoryError) - if not self.close_date: - frappe.throw(_("Close Date is required."), frappe.MandatoryError) + if not self.expected_deal_value or self.expected_deal_value == 0: + frappe.throw(_("Expected Deal Value is required."), frappe.MandatoryError) + if not self.expected_closure_date: + frappe.throw(_("Expected Closure Date is required."), frappe.MandatoryError) def validate_lost_reason(self): """