fix: added sla & sla priority doctype

This commit is contained in:
Shariq Ansari 2023-12-04 14:24:44 +05:30
parent 7c0e0e70e0
commit cd22d1a15d
10 changed files with 218 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("CRM Service Level Agreement", {
// refresh(frm) {
// },
// });
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"
);
}
},
});

View File

@ -0,0 +1,96 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "field:sla_name",
"creation": "2023-12-04 13:07:18.426211",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"sla_name",
"apply_on",
"enabled",
"default",
"column_break_uxua",
"condition",
"section_break_ufaf",
"priorities"
],
"fields": [
{
"fieldname": "sla_name",
"fieldtype": "Data",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "SLA Name",
"reqd": 1,
"unique": 1
},
{
"default": "0",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
},
{
"default": "0",
"fieldname": "default",
"fieldtype": "Check",
"label": "Default"
},
{
"fieldname": "column_break_uxua",
"fieldtype": "Column Break"
},
{
"description": "Simple Python Expression, Example: doc.status == 'Open' and doc.lead_source == 'Ads'",
"fieldname": "condition",
"fieldtype": "Code",
"label": "Condition",
"options": "Python"
},
{
"fieldname": "apply_on",
"fieldtype": "Link",
"label": "Apply On",
"link_filters": "[[{\"fieldname\":\"apply_on\",\"field_option\":\"DocType\"},\"name\",\"in\",[\"CRM Lead\",\"CRM Deal\"]]]",
"options": "DocType",
"reqd": 1
},
{
"fieldname": "section_break_ufaf",
"fieldtype": "Section Break"
},
{
"fieldname": "priorities",
"fieldtype": "Table",
"label": "Priorities",
"options": "CRM Service Level Priority",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-12-04 13:49:09.547523",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Service Level Agreement",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class CRMServiceLevelAgreement(Document):
pass

View File

@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
class TestCRMServiceLevelAgreement(FrappeTestCase):
pass

View File

@ -0,0 +1,8 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("CRM Service Level Priority", {
// refresh(frm) {
// },
// });

View File

@ -0,0 +1,57 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2023-12-04 13:18:58.028384",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"default_priority",
"reference_doctype",
"priority",
"first_response_time"
],
"fields": [
{
"default": "0",
"fieldname": "default_priority",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Default Priority"
},
{
"fieldname": "priority",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Priority",
"options": "reference_doctype",
"reqd": 1
},
{
"fieldname": "first_response_time",
"fieldtype": "Duration",
"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_by": "Administrator",
"module": "FCRM",
"name": "CRM Service Level Priority",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class CRMServiceLevelPriority(Document):
pass

View File

@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
class TestCRMServiceLevelPriority(FrappeTestCase):
pass