1
0
forked from test/crm

fix: capture closed on datetime when deal marked as Won

(cherry picked from commit 6450b69ae72ef2b7d57e30dacd314b27400e32ba)

# Conflicts:
#	crm/fcrm/doctype/crm_deal/crm_deal.json
This commit is contained in:
Shariq Ansari 2025-07-06 15:24:23 +05:30 committed by Mergify
parent d5aefb3c98
commit 63542f79c7
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@
"deal_value",
"column_break_kpxa",
"close_date",
"closed_on",
"contacts_tab",
"contacts",
"contact",
@ -409,12 +410,21 @@
"fieldtype": "Text",
"label": "Lost Notes",
"mandatory_depends_on": "eval: doc.lost_reason == \"Other\""
},
{
"fieldname": "closed_on",
"fieldtype": "Datetime",
"label": "Closed On"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
<<<<<<< HEAD
"modified": "2025-07-05 12:25:05.927806",
=======
"modified": "2025-07-06 15:16:37.673699",
>>>>>>> 6450b69a (fix: capture closed on datetime when deal marked as Won)
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Deal",

View File

@ -24,6 +24,8 @@ class CRMDeal(Document):
self.assign_agent(self.deal_owner)
if self.has_value_changed("status"):
add_status_change_log(self)
if self.status == "Won":
self.closed_on = frappe.utils.now_datetime()
self.validate_forcasting_fields()
self.validate_lost_reason()