fix: replaced lead/deal status with communication status in sla
This commit is contained in:
parent
cef998d1ba
commit
ce98110e36
@ -30,6 +30,7 @@
|
||||
"sla_creation",
|
||||
"column_break_pfvq",
|
||||
"sla_status",
|
||||
"communication_status",
|
||||
"response_details_section",
|
||||
"response_by",
|
||||
"column_break_hpvj",
|
||||
@ -195,11 +196,18 @@
|
||||
"fieldname": "first_responded_on",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "First Responded On"
|
||||
},
|
||||
{
|
||||
"default": "Open",
|
||||
"fieldname": "communication_status",
|
||||
"fieldtype": "Link",
|
||||
"label": "Communication Status",
|
||||
"options": "CRM Communication Status"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-12-11 12:37:51.198228",
|
||||
"modified": "2023-12-13 13:50:55.235109",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "CRM Deal",
|
||||
|
||||
@ -40,6 +40,7 @@
|
||||
"sla_creation",
|
||||
"column_break_ffnp",
|
||||
"sla_status",
|
||||
"communication_status",
|
||||
"response_details_section",
|
||||
"response_by",
|
||||
"column_break_pweh",
|
||||
@ -257,12 +258,19 @@
|
||||
"fieldname": "first_responded_on",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "First Responded On"
|
||||
},
|
||||
{
|
||||
"default": "Open",
|
||||
"fieldname": "communication_status",
|
||||
"fieldtype": "Link",
|
||||
"label": "Communication Status",
|
||||
"options": "CRM Communication Status"
|
||||
}
|
||||
],
|
||||
"image_field": "image",
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-12-10 13:54:53.630114",
|
||||
"modified": "2023-12-13 13:50:40.055487",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "CRM Lead",
|
||||
|
||||
@ -6,16 +6,3 @@
|
||||
|
||||
// },
|
||||
// });
|
||||
|
||||
frappe.ui.form.on("CRM Service Level Priority", {
|
||||
priorities_add: function (frm, cdt, cdn) {
|
||||
if (frm.doc.apply_on == "CRM Deal") {
|
||||
frappe.model.set_value(
|
||||
cdt,
|
||||
cdn,
|
||||
"reference_doctype",
|
||||
"CRM Deal Status"
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@ -17,7 +17,7 @@ from frappe.utils import (
|
||||
class CRMServiceLevelAgreement(Document):
|
||||
def apply(self, doc: Document):
|
||||
self.handle_new(doc)
|
||||
self.handle_status(doc)
|
||||
self.handle_communication_status(doc)
|
||||
self.handle_targets(doc)
|
||||
self.handle_sla_status(doc)
|
||||
|
||||
@ -27,14 +27,14 @@ class CRMServiceLevelAgreement(Document):
|
||||
creation = doc.sla_creation or now_datetime()
|
||||
doc.sla_creation = creation
|
||||
|
||||
def handle_status(self, doc: Document):
|
||||
if doc.is_new() or not doc.has_value_changed("status"):
|
||||
def handle_communication_status(self, doc: Document):
|
||||
if doc.is_new() or not doc.has_value_changed("communication_status"):
|
||||
return
|
||||
self.set_first_responded_on(doc)
|
||||
self.set_first_response_time(doc)
|
||||
|
||||
def set_first_responded_on(self, doc: Document):
|
||||
if doc.status != self.get_default_priority():
|
||||
if doc.communication_status != self.get_default_priority():
|
||||
doc.first_responded_on = (
|
||||
doc.first_responded_on or now_datetime()
|
||||
)
|
||||
@ -51,10 +51,10 @@ class CRMServiceLevelAgreement(Document):
|
||||
|
||||
def set_response_by(self, doc: Document):
|
||||
start_time = doc.sla_creation
|
||||
status = doc.status
|
||||
communication_status = doc.communication_status
|
||||
|
||||
priorities = self.get_priorities()
|
||||
priority = priorities.get(status)
|
||||
priority = priorities.get(communication_status)
|
||||
if not priority or doc.response_by:
|
||||
return
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"default_priority",
|
||||
"reference_doctype",
|
||||
"priority",
|
||||
"first_response_time"
|
||||
],
|
||||
@ -21,10 +20,10 @@
|
||||
},
|
||||
{
|
||||
"fieldname": "priority",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Priority",
|
||||
"options": "reference_doctype",
|
||||
"options": "CRM Communication Status",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
@ -33,19 +32,12 @@
|
||||
"in_list_view": 1,
|
||||
"label": "First Response TIme",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "CRM Lead Status",
|
||||
"fieldname": "reference_doctype",
|
||||
"fieldtype": "Link",
|
||||
"label": "DocType",
|
||||
"options": "DocType"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2023-12-04 14:05:42.838493",
|
||||
"modified": "2023-12-13 13:26:51.757839",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "CRM Service Level Priority",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user