fix: set close date to now if status is Won
(cherry picked from commit a98b0e3a009f028c86ebb87385136ad0ab711a81)
This commit is contained in:
parent
d06f749544
commit
e9362a50eb
@ -24,6 +24,7 @@ class CRMDeal(Document):
|
|||||||
self.assign_agent(self.deal_owner)
|
self.assign_agent(self.deal_owner)
|
||||||
if self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
add_status_change_log(self)
|
add_status_change_log(self)
|
||||||
|
self.update_close_date()
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
if self.deal_owner:
|
if self.deal_owner:
|
||||||
@ -133,6 +134,13 @@ class CRMDeal(Document):
|
|||||||
if sla:
|
if sla:
|
||||||
sla.apply(self)
|
sla.apply(self)
|
||||||
|
|
||||||
|
def update_close_date(self):
|
||||||
|
"""
|
||||||
|
Update the close date based on the "Won" status.
|
||||||
|
"""
|
||||||
|
if self.status == "Won" and not self.close_date:
|
||||||
|
self.close_date = frappe.utils.nowdate()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_list_data():
|
def default_list_data():
|
||||||
columns = [
|
columns = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user