From 0e443f926a229ab1c754ce773de8e3fb9e738198 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 14 Dec 2023 11:40:12 +0530 Subject: [PATCH] fix: added holiday list & holiday doctype for SLA --- crm/fcrm/doctype/crm_holiday/__init__.py | 0 crm/fcrm/doctype/crm_holiday/crm_holiday.json | 57 +++++++++ crm/fcrm/doctype/crm_holiday/crm_holiday.py | 9 ++ crm/fcrm/doctype/crm_holiday_list/__init__.py | 0 .../crm_holiday_list/crm_holiday_list.js | 8 ++ .../crm_holiday_list/crm_holiday_list.json | 111 ++++++++++++++++++ .../crm_holiday_list/crm_holiday_list.py | 9 ++ .../crm_holiday_list/test_crm_holiday_list.py | 9 ++ 8 files changed, 203 insertions(+) create mode 100644 crm/fcrm/doctype/crm_holiday/__init__.py create mode 100644 crm/fcrm/doctype/crm_holiday/crm_holiday.json create mode 100644 crm/fcrm/doctype/crm_holiday/crm_holiday.py create mode 100644 crm/fcrm/doctype/crm_holiday_list/__init__.py create mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js create mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json create mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py create mode 100644 crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py diff --git a/crm/fcrm/doctype/crm_holiday/__init__.py b/crm/fcrm/doctype/crm_holiday/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_holiday/crm_holiday.json b/crm/fcrm/doctype/crm_holiday/crm_holiday.json new file mode 100644 index 00000000..fc0f24f3 --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday/crm_holiday.json @@ -0,0 +1,57 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-12-14 11:16:15.476366", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "date", + "column_break_xzyo", + "weekly_off", + "section_break_zenz", + "description" + ], + "fields": [ + { + "fieldname": "date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Date", + "reqd": 1 + }, + { + "fieldname": "column_break_xzyo", + "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "weekly_off", + "fieldtype": "Check", + "label": "Weekly Off" + }, + { + "fieldname": "section_break_zenz", + "fieldtype": "Section Break" + }, + { + "fieldname": "description", + "fieldtype": "Text Editor", + "in_list_view": 1, + "label": "Description", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-12-14 11:17:41.745419", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Holiday", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_holiday/crm_holiday.py b/crm/fcrm/doctype/crm_holiday/crm_holiday.py new file mode 100644 index 00000000..d77b735d --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday/crm_holiday.py @@ -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 CRMHoliday(Document): + pass diff --git a/crm/fcrm/doctype/crm_holiday_list/__init__.py b/crm/fcrm/doctype/crm_holiday_list/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js new file mode 100644 index 00000000..914d43de --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js @@ -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 Holiday List", { +// refresh(frm) { + +// }, +// }); diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json new file mode 100644 index 00000000..a6a8ab6b --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json @@ -0,0 +1,111 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:holiday_list_name", + "creation": "2023-12-14 11:09:12.876640", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "holiday_list_name", + "from_date", + "to_date", + "column_break_qwqc", + "total_holidays", + "add_weekly_holidays_section", + "weekly_off", + "add_to_holidays", + "holidays_section", + "holidays", + "clear_table" + ], + "fields": [ + { + "fieldname": "holiday_list_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Holiday List Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "reqd": 1 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "To Date", + "reqd": 1 + }, + { + "fieldname": "column_break_qwqc", + "fieldtype": "Column Break" + }, + { + "fieldname": "total_holidays", + "fieldtype": "Int", + "label": "Total Holidays" + }, + { + "fieldname": "add_weekly_holidays_section", + "fieldtype": "Section Break", + "label": "Add Weekly Holidays" + }, + { + "fieldname": "weekly_off", + "fieldtype": "Select", + "label": "Weekly Off", + "options": "\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday" + }, + { + "fieldname": "add_to_holidays", + "fieldtype": "Button", + "label": "Add to Holidays" + }, + { + "fieldname": "holidays_section", + "fieldtype": "Section Break", + "label": "Holidays" + }, + { + "fieldname": "clear_table", + "fieldtype": "Button", + "label": "Clear Table" + }, + { + "fieldname": "holidays", + "fieldtype": "Table", + "label": "Holidays", + "options": "CRM Holiday" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-12-14 11:18:27.236817", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Holiday List", + "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": [] +} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py new file mode 100644 index 00000000..45c8b101 --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py @@ -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 CRMHolidayList(Document): + pass diff --git a/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py b/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py new file mode 100644 index 00000000..87754859 --- /dev/null +++ b/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py @@ -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 TestCRMHolidayList(FrappeTestCase): + pass