chore: resolved conflict
This commit is contained in:
parent
5d01b88a1e
commit
92d7280728
@ -15,6 +15,7 @@
|
||||
"status",
|
||||
"deal_owner",
|
||||
"lost_reason",
|
||||
"other_lost_reason",
|
||||
"section_break_jgpm",
|
||||
"probability",
|
||||
"deal_value",
|
||||
@ -397,13 +398,21 @@
|
||||
"fieldname": "lost_reason",
|
||||
"fieldtype": "Link",
|
||||
"label": "Lost Reason",
|
||||
"mandatory_depends_on": "eval: doc.status == \"Lost\"",
|
||||
"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,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2025-06-30 17:40:28.673539",
|
||||
"modified": "2025-06-30 17:53:23.408301",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "CRM Deal",
|
||||
|
||||
@ -25,6 +25,7 @@ class CRMDeal(Document):
|
||||
if self.has_value_changed("status"):
|
||||
add_status_change_log(self)
|
||||
self.validate_forcasting_fields()
|
||||
self.validate_lost_reason()
|
||||
|
||||
def after_insert(self):
|
||||
if self.deal_owner:
|
||||
@ -149,6 +150,16 @@ class CRMDeal(Document):
|
||||
if not self.close_date:
|
||||
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
|
||||
def default_list_data():
|
||||
columns = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user