From 8defe6285f5a503cb961e4c02561e5cfbd6cff6b Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 14 Jul 2025 14:13:50 +0530 Subject: [PATCH] fix: added crm dashboard doctype to store dashboard layout (cherry picked from commit ed2208fe75de2d4d7f2e6f27cf036d2f058088b1) --- crm/fcrm/doctype/crm_dashboard/__init__.py | 0 .../doctype/crm_dashboard/crm_dashboard.js | 8 ++ .../doctype/crm_dashboard/crm_dashboard.json | 105 ++++++++++++++++++ .../doctype/crm_dashboard/crm_dashboard.py | 9 ++ .../crm_dashboard/test_crm_dashboard.py | 30 +++++ 5 files changed, 152 insertions(+) create mode 100644 crm/fcrm/doctype/crm_dashboard/__init__.py create mode 100644 crm/fcrm/doctype/crm_dashboard/crm_dashboard.js create mode 100644 crm/fcrm/doctype/crm_dashboard/crm_dashboard.json create mode 100644 crm/fcrm/doctype/crm_dashboard/crm_dashboard.py create mode 100644 crm/fcrm/doctype/crm_dashboard/test_crm_dashboard.py diff --git a/crm/fcrm/doctype/crm_dashboard/__init__.py b/crm/fcrm/doctype/crm_dashboard/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_dashboard/crm_dashboard.js b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.js new file mode 100644 index 00000000..9aee84c7 --- /dev/null +++ b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.js @@ -0,0 +1,8 @@ +// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("CRM Dashboard", { +// refresh(frm) { + +// }, +// }); diff --git a/crm/fcrm/doctype/crm_dashboard/crm_dashboard.json b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.json new file mode 100644 index 00000000..11dcdec4 --- /dev/null +++ b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.json @@ -0,0 +1,105 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:title", + "creation": "2025-07-14 12:19:49.725022", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "title", + "private", + "column_break_exbw", + "user", + "section_break_hfza", + "layout" + ], + "fields": [ + { + "fieldname": "column_break_exbw", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_hfza", + "fieldtype": "Section Break" + }, + { + "default": "[]", + "fieldname": "layout", + "fieldtype": "Code", + "label": "Layout", + "options": "JSON" + }, + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Name", + "unique": 1 + }, + { + "depends_on": "private", + "fieldname": "user", + "fieldtype": "Link", + "label": "User", + "mandatory_depends_on": "private", + "options": "User" + }, + { + "default": "0", + "fieldname": "private", + "fieldtype": "Check", + "label": "Private" + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "links": [], + "modified": "2025-07-14 12:36:10.831351", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Dashboard", + "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 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "share": 1, + "write": 1 + } + ], + "row_format": "Dynamic", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "title_field": "title" +} diff --git a/crm/fcrm/doctype/crm_dashboard/crm_dashboard.py b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.py new file mode 100644 index 00000000..b1edf4b8 --- /dev/null +++ b/crm/fcrm/doctype/crm_dashboard/crm_dashboard.py @@ -0,0 +1,9 @@ +# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class CRMDashboard(Document): + pass diff --git a/crm/fcrm/doctype/crm_dashboard/test_crm_dashboard.py b/crm/fcrm/doctype/crm_dashboard/test_crm_dashboard.py new file mode 100644 index 00000000..7e915613 --- /dev/null +++ b/crm/fcrm/doctype/crm_dashboard/test_crm_dashboard.py @@ -0,0 +1,30 @@ +# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests import IntegrationTestCase, UnitTestCase + + +# On IntegrationTestCase, the doctype test records and all +# link-field test record dependencies are recursively loaded +# Use these module variables to add/remove to/from that list +EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] +IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] + + +class UnitTestCRMDashboard(UnitTestCase): + """ + Unit tests for CRMDashboard. + Use this class for testing individual functions and methods. + """ + + pass + + +class IntegrationTestCRMDashboard(IntegrationTestCase): + """ + Integration tests for CRMDashboard. + Use this class for testing interactions between multiple components. + """ + + pass