From 4eaf68f2339691d3d89276448dc9fef7a340bf51 Mon Sep 17 00:00:00 2001 From: Geethu k Date: Fri, 20 Oct 2023 15:45:43 +0530 Subject: [PATCH] feat: Created doctype Smith Details --- aumms/aumms/custom/department.json | 70 +++++++++++ aumms/aumms/doctype/smith_details/__init__.py | 0 .../doctype/smith_details/smith_details.js | 6 + .../doctype/smith_details/smith_details.json | 117 ++++++++++++++++++ .../doctype/smith_details/smith_details.py | 8 ++ .../smith_details/test_smith_details.py | 9 ++ aumms/fixtures/role.json | 42 +++++++ aumms/hooks.py | 2 +- 8 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 aumms/aumms/custom/department.json create mode 100644 aumms/aumms/doctype/smith_details/__init__.py create mode 100644 aumms/aumms/doctype/smith_details/smith_details.js create mode 100644 aumms/aumms/doctype/smith_details/smith_details.json create mode 100644 aumms/aumms/doctype/smith_details/smith_details.py create mode 100644 aumms/aumms/doctype/smith_details/test_smith_details.py diff --git a/aumms/aumms/custom/department.json b/aumms/aumms/custom/department.json new file mode 100644 index 00000000..03c126f0 --- /dev/null +++ b/aumms/aumms/custom/department.json @@ -0,0 +1,70 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2023-10-20 15:16:08.680216", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Department", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "head_of_department", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 3, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "parent_department", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Head of Department", + "length": 0, + "mandatory_depends_on": null, + "modified": "2023-10-20 15:16:08.680216", + "modified_by": "Administrator", + "module": null, + "name": "Department-head_of_department", + "no_copy": 0, + "non_negative": 0, + "options": "Employee", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Department", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/aumms/aumms/doctype/smith_details/__init__.py b/aumms/aumms/doctype/smith_details/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/aumms/aumms/doctype/smith_details/smith_details.js b/aumms/aumms/doctype/smith_details/smith_details.js new file mode 100644 index 00000000..539e786f --- /dev/null +++ b/aumms/aumms/doctype/smith_details/smith_details.js @@ -0,0 +1,6 @@ +// Copyright (c) 2023, efeone and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Smith Details', { + +}); diff --git a/aumms/aumms/doctype/smith_details/smith_details.json b/aumms/aumms/doctype/smith_details/smith_details.json new file mode 100644 index 00000000..0d322dfa --- /dev/null +++ b/aumms/aumms/doctype/smith_details/smith_details.json @@ -0,0 +1,117 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "format:S{######}", + "creation": "2023-10-18 10:02:01.800347", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "smith_type", + "employee", + "supplier", + "supplier_name", + "employee_name", + "column_break_mhz6m", + "warehouse", + "department", + "head_of_smith", + "section_break_9mmii", + "hourly_rate" + ], + "fields": [ + { + "fieldname": "smith_type", + "fieldtype": "Select", + "label": "Smith Type", + "options": "\nInternal\nExternal" + }, + { + "fieldname": "department", + "fieldtype": "Link", + "label": "Department", + "options": "Department" + }, + { + "fieldname": "hourly_rate", + "fieldtype": "Data", + "label": "Hourly Rate" + }, + { + "fetch_from": "department.head_of_department", + "fieldname": "head_of_smith", + "fieldtype": "Link", + "label": "Head of smith", + "options": "Employee" + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "label": "Warehouse", + "options": "Warehouse" + }, + { + "depends_on": "eval:doc.smith_type == 'External'", + "fieldname": "supplier", + "fieldtype": "Link", + "label": "Supplier", + "options": "Supplier" + }, + { + "depends_on": "eval:doc.smith_type == 'Internal'", + "fieldname": "employee", + "fieldtype": "Link", + "label": "Employee", + "options": "Employee" + }, + { + "fieldname": "column_break_mhz6m", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_9mmii", + "fieldtype": "Section Break" + }, + { + "depends_on": "eval:doc.smith_type == 'External'", + "fetch_from": "supplier.supplier_name", + "fieldname": "supplier_name", + "fieldtype": "Data", + "label": "Supplier Name" + }, + { + "depends_on": "eval:doc.smith_type =='Internal'", + "fetch_from": "employee.employee_name", + "fieldname": "employee_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Employee Name" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-10-20 16:01:00.222753", + "modified_by": "Administrator", + "module": "AuMMS", + "name": "Smith Details", + "naming_rule": "Expression", + "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/aumms/aumms/doctype/smith_details/smith_details.py b/aumms/aumms/doctype/smith_details/smith_details.py new file mode 100644 index 00000000..0d86a073 --- /dev/null +++ b/aumms/aumms/doctype/smith_details/smith_details.py @@ -0,0 +1,8 @@ +# Copyright (c) 2023, efeone and contributors +# For license information, please see license.txt + +from frappe.model.document import Document + + +class SmithDetails(Document): + pass \ No newline at end of file diff --git a/aumms/aumms/doctype/smith_details/test_smith_details.py b/aumms/aumms/doctype/smith_details/test_smith_details.py new file mode 100644 index 00000000..8579315c --- /dev/null +++ b/aumms/aumms/doctype/smith_details/test_smith_details.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, efeone and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestSmithDetails(FrappeTestCase): + pass diff --git a/aumms/fixtures/role.json b/aumms/fixtures/role.json index effe1469..15ebdf02 100644 --- a/aumms/fixtures/role.json +++ b/aumms/fixtures/role.json @@ -40,5 +40,47 @@ "timeline": 1, "two_factor_auth": 0, "view_switcher": 1 + }, + { + "bulk_actions": 1, + "dashboard": 1, + "desk_access": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Role", + "form_sidebar": 1, + "home_page": null, + "is_custom": 0, + "list_sidebar": 1, + "modified": "2023-10-18 15:34:02.128307", + "name": "Head of Smith", + "notifications": 1, + "restrict_to_domain": null, + "role_name": "Head of Smith", + "search_bar": 1, + "timeline": 1, + "two_factor_auth": 0, + "view_switcher": 1 + }, + { + "bulk_actions": 1, + "dashboard": 1, + "desk_access": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Role", + "form_sidebar": 1, + "home_page": null, + "is_custom": 0, + "list_sidebar": 1, + "modified": "2023-10-18 16:03:05.894641", + "name": "Smith", + "notifications": 1, + "restrict_to_domain": null, + "role_name": "Smith", + "search_bar": 1, + "timeline": 1, + "two_factor_auth": 0, + "view_switcher": 1 } ] \ No newline at end of file diff --git a/aumms/hooks.py b/aumms/hooks.py index be4baa80..46828b55 100644 --- a/aumms/hooks.py +++ b/aumms/hooks.py @@ -84,7 +84,7 @@ # Uninstallation # ------------ -fixtures = [{"dt": "Role","filters": [["name", "in", ["Design Analyst", "Supervisor"]]]}, +fixtures = [{"dt": "Role","filters": [["name", "in", ["Design Analyst", "Supervisor","Smith","Head of Smith"]]]}, ] # before_uninstall = "aumms.uninstall.before_uninstall" # after_uninstall = "aumms.uninstall.after_uninstall"