From f835acae57bbb0ed007ae9b0fa2063f478c3e537 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 21 May 2025 14:49:59 +0530 Subject: [PATCH] feat: added crm agent doctype (cherry picked from commit fac5ed5579c45868e442bd68dca8007f0553d617) --- crm/fcrm/doctype/crm_agent/__init__.py | 0 crm/fcrm/doctype/crm_agent/crm_agent.js | 8 ++ crm/fcrm/doctype/crm_agent/crm_agent.json | 98 ++++++++++++++++++++ crm/fcrm/doctype/crm_agent/crm_agent.py | 9 ++ crm/fcrm/doctype/crm_agent/test_crm_agent.py | 29 ++++++ 5 files changed, 144 insertions(+) create mode 100644 crm/fcrm/doctype/crm_agent/__init__.py create mode 100644 crm/fcrm/doctype/crm_agent/crm_agent.js create mode 100644 crm/fcrm/doctype/crm_agent/crm_agent.json create mode 100644 crm/fcrm/doctype/crm_agent/crm_agent.py create mode 100644 crm/fcrm/doctype/crm_agent/test_crm_agent.py diff --git a/crm/fcrm/doctype/crm_agent/__init__.py b/crm/fcrm/doctype/crm_agent/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_agent/crm_agent.js b/crm/fcrm/doctype/crm_agent/crm_agent.js new file mode 100644 index 00000000..042c06ea --- /dev/null +++ b/crm/fcrm/doctype/crm_agent/crm_agent.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 Agent", { +// refresh(frm) { + +// }, +// }); diff --git a/crm/fcrm/doctype/crm_agent/crm_agent.json b/crm/fcrm/doctype/crm_agent/crm_agent.json new file mode 100644 index 00000000..e3ee9758 --- /dev/null +++ b/crm/fcrm/doctype/crm_agent/crm_agent.json @@ -0,0 +1,98 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:user", + "creation": "2025-05-21 12:59:26.007215", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "user", + "is_active", + "section_break_qdxc", + "first_name", + "middle_name", + "last_name", + "column_break_kpoq", + "agent_name", + "image" + ], + "fields": [ + { + "fieldname": "user", + "fieldtype": "Link", + "label": "User", + "options": "User", + "unique": 1 + }, + { + "default": "1", + "fieldname": "is_active", + "fieldtype": "Check", + "label": "Is Active" + }, + { + "fieldname": "section_break_qdxc", + "fieldtype": "Section Break" + }, + { + "fieldname": "agent_name", + "fieldtype": "Data", + "label": "Full Name" + }, + { + "fieldname": "column_break_kpoq", + "fieldtype": "Column Break" + }, + { + "fieldname": "image", + "fieldtype": "Attach Image", + "label": "Image" + }, + { + "fieldname": "first_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "First Name", + "reqd": 1 + }, + { + "fieldname": "middle_name", + "fieldtype": "Data", + "label": "Middle Name" + }, + { + "fieldname": "last_name", + "fieldtype": "Data", + "label": "Last Name" + } + ], + "grid_page_length": 50, + "image_field": "image", + "index_web_pages_for_search": 1, + "links": [], + "modified": "2025-05-21 13:25:01.497196", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Agent", + "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 + } + ], + "row_format": "Dynamic", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "title_field": "agent_name" +} diff --git a/crm/fcrm/doctype/crm_agent/crm_agent.py b/crm/fcrm/doctype/crm_agent/crm_agent.py new file mode 100644 index 00000000..3b7709c8 --- /dev/null +++ b/crm/fcrm/doctype/crm_agent/crm_agent.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 CRMAgent(Document): + pass diff --git a/crm/fcrm/doctype/crm_agent/test_crm_agent.py b/crm/fcrm/doctype/crm_agent/test_crm_agent.py new file mode 100644 index 00000000..ebc29c58 --- /dev/null +++ b/crm/fcrm/doctype/crm_agent/test_crm_agent.py @@ -0,0 +1,29 @@ +# 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 UnitTestCRMAgent(UnitTestCase): + """ + Unit tests for CRMAgent. + Use this class for testing individual functions and methods. + """ + + pass + + +class IntegrationTestCRMAgent(IntegrationTestCase): + """ + Integration tests for CRMAgent. + Use this class for testing interactions between multiple components. + """ + + pass