chore: resolved conflict
(cherry picked from commit 92d728072843b1449cb2e2e626cde7a218e68530)
This commit is contained in:
parent
252fe05edc
commit
6aa4a03b0f
@ -15,6 +15,7 @@
|
|||||||
"status",
|
"status",
|
||||||
"deal_owner",
|
"deal_owner",
|
||||||
"lost_reason",
|
"lost_reason",
|
||||||
|
"other_lost_reason",
|
||||||
"section_break_jgpm",
|
"section_break_jgpm",
|
||||||
"probability",
|
"probability",
|
||||||
"deal_value",
|
"deal_value",
|
||||||
@ -397,13 +398,21 @@
|
|||||||
"fieldname": "lost_reason",
|
"fieldname": "lost_reason",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Lost Reason",
|
"label": "Lost Reason",
|
||||||
|
"mandatory_depends_on": "eval: doc.status == \"Lost\"",
|
||||||
"options": "CRM Lost Reason"
|
"options": "CRM Lost Reason"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval: doc.lost_reason == \"Other\"",
|
||||||
|
"fieldname": "other_lost_reason",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Specify Other Reason",
|
||||||
|
"mandatory_depends_on": "eval: doc.lost_reason == \"Other\""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-06-30 17:40:28.673539",
|
"modified": "2025-06-30 17:53:23.408301",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Deal",
|
"name": "CRM Deal",
|
||||||
|
|||||||
@ -25,6 +25,7 @@ class CRMDeal(Document):
|
|||||||
if self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
add_status_change_log(self)
|
add_status_change_log(self)
|
||||||
self.validate_forcasting_fields()
|
self.validate_forcasting_fields()
|
||||||
|
self.validate_lost_reason()
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
if self.deal_owner:
|
if self.deal_owner:
|
||||||
@ -149,6 +150,16 @@ class CRMDeal(Document):
|
|||||||
if not self.close_date:
|
if not self.close_date:
|
||||||
frappe.throw(_("Close Date is required."), frappe.MandatoryError)
|
frappe.throw(_("Close Date is required."), frappe.MandatoryError)
|
||||||
|
|
||||||
|
def validate_lost_reason(self):
|
||||||
|
"""
|
||||||
|
Validate the lost reason if the status is set to "Lost".
|
||||||
|
"""
|
||||||
|
if self.status == "Lost":
|
||||||
|
if not self.lost_reason:
|
||||||
|
frappe.throw(_("Please specify a reason for losing the deal."), frappe.ValidationError)
|
||||||
|
elif self.lost_reason == "Other" and not self.other_lost_reason:
|
||||||
|
frappe.throw(_("Please specify the reason for losing the deal."), frappe.ValidationError)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_list_data():
|
def default_list_data():
|
||||||
columns = [
|
columns = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user