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",
|
"sla_creation",
|
||||||
"column_break_pfvq",
|
"column_break_pfvq",
|
||||||
"sla_status",
|
"sla_status",
|
||||||
|
"communication_status",
|
||||||
"response_details_section",
|
"response_details_section",
|
||||||
"response_by",
|
"response_by",
|
||||||
"column_break_hpvj",
|
"column_break_hpvj",
|
||||||
@ -195,11 +196,18 @@
|
|||||||
"fieldname": "first_responded_on",
|
"fieldname": "first_responded_on",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"label": "First Responded On"
|
"label": "First Responded On"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "Open",
|
||||||
|
"fieldname": "communication_status",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Communication Status",
|
||||||
|
"options": "CRM Communication Status"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-12-11 12:37:51.198228",
|
"modified": "2023-12-13 13:50:55.235109",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Deal",
|
"name": "CRM Deal",
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
"sla_creation",
|
"sla_creation",
|
||||||
"column_break_ffnp",
|
"column_break_ffnp",
|
||||||
"sla_status",
|
"sla_status",
|
||||||
|
"communication_status",
|
||||||
"response_details_section",
|
"response_details_section",
|
||||||
"response_by",
|
"response_by",
|
||||||
"column_break_pweh",
|
"column_break_pweh",
|
||||||
@ -257,12 +258,19 @@
|
|||||||
"fieldname": "first_responded_on",
|
"fieldname": "first_responded_on",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"label": "First Responded On"
|
"label": "First Responded On"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "Open",
|
||||||
|
"fieldname": "communication_status",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Communication Status",
|
||||||
|
"options": "CRM Communication Status"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-12-10 13:54:53.630114",
|
"modified": "2023-12-13 13:50:40.055487",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Lead",
|
"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):
|
class CRMServiceLevelAgreement(Document):
|
||||||
def apply(self, doc: Document):
|
def apply(self, doc: Document):
|
||||||
self.handle_new(doc)
|
self.handle_new(doc)
|
||||||
self.handle_status(doc)
|
self.handle_communication_status(doc)
|
||||||
self.handle_targets(doc)
|
self.handle_targets(doc)
|
||||||
self.handle_sla_status(doc)
|
self.handle_sla_status(doc)
|
||||||
|
|
||||||
@ -27,14 +27,14 @@ class CRMServiceLevelAgreement(Document):
|
|||||||
creation = doc.sla_creation or now_datetime()
|
creation = doc.sla_creation or now_datetime()
|
||||||
doc.sla_creation = creation
|
doc.sla_creation = creation
|
||||||
|
|
||||||
def handle_status(self, doc: Document):
|
def handle_communication_status(self, doc: Document):
|
||||||
if doc.is_new() or not doc.has_value_changed("status"):
|
if doc.is_new() or not doc.has_value_changed("communication_status"):
|
||||||
return
|
return
|
||||||
self.set_first_responded_on(doc)
|
self.set_first_responded_on(doc)
|
||||||
self.set_first_response_time(doc)
|
self.set_first_response_time(doc)
|
||||||
|
|
||||||
def set_first_responded_on(self, doc: Document):
|
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 = (
|
||||||
doc.first_responded_on or now_datetime()
|
doc.first_responded_on or now_datetime()
|
||||||
)
|
)
|
||||||
@ -51,10 +51,10 @@ class CRMServiceLevelAgreement(Document):
|
|||||||
|
|
||||||
def set_response_by(self, doc: Document):
|
def set_response_by(self, doc: Document):
|
||||||
start_time = doc.sla_creation
|
start_time = doc.sla_creation
|
||||||
status = doc.status
|
communication_status = doc.communication_status
|
||||||
|
|
||||||
priorities = self.get_priorities()
|
priorities = self.get_priorities()
|
||||||
priority = priorities.get(status)
|
priority = priorities.get(communication_status)
|
||||||
if not priority or doc.response_by:
|
if not priority or doc.response_by:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"default_priority",
|
"default_priority",
|
||||||
"reference_doctype",
|
|
||||||
"priority",
|
"priority",
|
||||||
"first_response_time"
|
"first_response_time"
|
||||||
],
|
],
|
||||||
@ -21,10 +20,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "priority",
|
"fieldname": "priority",
|
||||||
"fieldtype": "Dynamic Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Priority",
|
"label": "Priority",
|
||||||
"options": "reference_doctype",
|
"options": "CRM Communication Status",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -33,19 +32,12 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "First Response TIme",
|
"label": "First Response TIme",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": "CRM Lead Status",
|
|
||||||
"fieldname": "reference_doctype",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "DocType",
|
|
||||||
"options": "DocType"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-12-04 14:05:42.838493",
|
"modified": "2023-12-13 13:26:51.757839",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Service Level Priority",
|
"name": "CRM Service Level Priority",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user