Skip to content

Commit

Permalink
Merge pull request #154 from efeone/TASK-2023-00406
Browse files Browse the repository at this point in the history
feat: Created doctype Smith Details
  • Loading branch information
muhammadmp authored Oct 20, 2023
2 parents 46f0615 + 4eaf68f commit a1909a5
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 1 deletion.
70 changes: 70 additions & 0 deletions aumms/aumms/custom/department.json
Original file line number Diff line number Diff line change
@@ -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
}
Empty file.
6 changes: 6 additions & 0 deletions aumms/aumms/doctype/smith_details/smith_details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2023, efeone and contributors
// For license information, please see license.txt

frappe.ui.form.on('Smith Details', {

});
117 changes: 117 additions & 0 deletions aumms/aumms/doctype/smith_details/smith_details.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 8 additions & 0 deletions aumms/aumms/doctype/smith_details/smith_details.py
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions aumms/aumms/doctype/smith_details/test_smith_details.py
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions aumms/fixtures/role.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 1 addition & 1 deletion aumms/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a1909a5

Please sign in to comment.