diff --git a/msp/hooks.py b/msp/hooks.py index 5df4a86..9fdebce 100644 --- a/msp/hooks.py +++ b/msp/hooks.py @@ -39,6 +39,8 @@ jenv = { # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} +doctype_js = {"Location" : "public/js/location.js"} + # Home Pages # ---------- @@ -87,11 +89,11 @@ jenv = { # --------------- # Hook on document methods and events -# doc_events = { -# "Customer": { -# "on_update": "msp.msp.customer_quick_entry.custom_customer_info" -# } -# } +doc_events = { + "Location": { + "before_save": "msp.tools.hooks_methods.build_full_location_path" + } +} # Scheduled Tasks # --------------- @@ -133,3 +135,6 @@ jenv = { # "Task": "msp.task.get_dashboard_data" # } +override_doctype_class = { + "Location": "msp.overrides.location.CustomLocation.CustomLocation" +} diff --git a/msp/msp/custom/location.json b/msp/msp/custom/location.json new file mode 100644 index 0000000..231f59c --- /dev/null +++ b/msp/msp/custom/location.json @@ -0,0 +1,237 @@ +{ + "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": "2022-09-06 09:39:15.583037", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Location", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "full_path", + "fieldtype": "Data", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 4, + "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": "html_full_path", + "label": "Full Path", + "length": 1000, + "mandatory_depends_on": null, + "modified": "2022-09-06 09:39:15.583037", + "modified_by": "Administrator", + "name": "Location-full_path", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "", + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": "" + }, + { + "_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": "2022-09-06 15:02:44.835105", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Location", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "html_full_path", + "fieldtype": "Text Editor", + "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_location", + "label": "HTML Full Path", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-06 15:02:44.835105", + "modified_by": "Administrator", + "name": "Location-html_full_path", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_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": "2022-09-06 15:12:53.892684", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Location", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "type", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 5, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "full_path", + "label": "Type", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-06 15:12:53.892684", + "modified_by": "Administrator", + "name": "Location-type", + "no_copy": 0, + "non_negative": 0, + "options": "\nCountry\nState\nCity\nStreet\nBuilding\nFloor\nRoom\nRack\nHU", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 1, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Location", + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2022-09-06 13:12:35.858567", + "default_value": null, + "doc_type": "Location", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "modified": "2022-09-06 13:12:35.858567", + "modified_by": "Administrator", + "name": "Location-main-search_fields", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "search_fields", + "property_type": "Data", + "row_name": null, + "value": "location_name, full_path" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2022-09-06 09:37:34.757324", + "default_value": null, + "doc_type": "Location", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "modified": "2022-09-06 09:37:34.757324", + "modified_by": "Administrator", + "name": "Location-main-autoname", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "autoname", + "property_type": "Data", + "row_name": null, + "value": "LOC-.#####" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/msp/msp/custom/todo.json b/msp/msp/custom/todo.json new file mode 100644 index 0000000..80fe3f8 --- /dev/null +++ b/msp/msp/custom/todo.json @@ -0,0 +1,308 @@ +{ + "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": "2022-09-05 12:52:53.000762", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "ToDo", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "ip_network", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 19, + "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": "assignment_rule", + "label": "IP Network", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-05 12:52:53.000762", + "modified_by": "Administrator", + "name": "ToDo-ip_network", + "no_copy": 0, + "non_negative": 0, + "options": "IP Network", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_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": "2022-09-05 12:56:53.645299", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "ToDo", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "it_landscape", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 20, + "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": "ip_network", + "label": "IT Landscape", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-05 12:56:53.645299", + "modified_by": "Administrator", + "name": "ToDo-it_landscape", + "no_copy": 0, + "non_negative": 0, + "options": "IT Landscape", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_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": "2022-09-05 12:56:53.920916", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "ToDo", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "it_object", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 21, + "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": "it_landscape", + "label": "IT Object", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-05 12:56:53.920916", + "modified_by": "Administrator", + "name": "ToDo-it_object", + "no_copy": 0, + "non_negative": 0, + "options": "IT Object", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_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": "2022-09-05 12:56:54.064975", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "ToDo", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "ip_address", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 22, + "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": "it_object", + "label": "IP Address", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-05 12:56:54.064975", + "modified_by": "Administrator", + "name": "ToDo-ip_address", + "no_copy": 0, + "non_negative": 0, + "options": "IP Address", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_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": "2022-09-05 13:10:58.880444", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "ToDo", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "it_user_account", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 22, + "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": "ip_address", + "label": "IT User Account", + "length": 0, + "mandatory_depends_on": null, + "modified": "2022-09-05 13:10:58.880444", + "modified_by": "Administrator", + "name": "ToDo-it_user_account", + "no_copy": 0, + "non_negative": 0, + "options": "IT User Account", + "owner": "Administrator", + "parent": null, + "parentfield": null, + "parenttype": null, + "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, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "ToDo", + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/msp/msp/doctype/ip_address/ip_address.json b/msp/msp/doctype/ip_address/ip_address.json index 4b1f6d1..a8692fd 100644 --- a/msp/msp/doctype/ip_address/ip_address.json +++ b/msp/msp/doctype/ip_address/ip_address.json @@ -10,6 +10,7 @@ "title", "ip_address", "protocol", + "it_object_name", "it_object", "ip_network", "it_landscape" @@ -37,7 +38,8 @@ "fieldname": "it_object", "fieldtype": "Link", "label": "IT Object", - "options": "IT Object" + "options": "IT Object", + "read_only": 1 }, { "fieldname": "it_landscape", @@ -52,10 +54,16 @@ "label": "IP Network", "options": "IP Network", "reqd": 1 + }, + { + "fieldname": "it_object_name", + "fieldtype": "Data", + "label": "IT Object Name", + "read_only": 1 } ], "links": [], - "modified": "2022-06-17 11:21:47.850521", + "modified": "2022-09-05 12:03:39.294521", "modified_by": "Administrator", "module": "MSP", "name": "IP Address", diff --git a/msp/msp/doctype/ip_address/ip_address_dashboard.py b/msp/msp/doctype/ip_address/ip_address_dashboard.py new file mode 100644 index 0000000..e2d4eb9 --- /dev/null +++ b/msp/msp/doctype/ip_address/ip_address_dashboard.py @@ -0,0 +1,14 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'heatmap': False, + 'fieldname': 'ip_address', + 'transactions': [ + { + 'label': _('Processes'), + 'items': ['ToDo'] + } + ] + } diff --git a/msp/msp/doctype/ip_network/ip_network.json b/msp/msp/doctype/ip_network/ip_network.json index 2cf5750..ae54fed 100644 --- a/msp/msp/doctype/ip_network/ip_network.json +++ b/msp/msp/doctype/ip_network/ip_network.json @@ -27,6 +27,7 @@ "it_landscape", "description", "customer", + "location_full_path", "location", "ip_network_reserved_ranges_section", "ip_network_reserved_ranges_table", @@ -172,10 +173,17 @@ "fieldtype": "HTML", "label": "Usage Overview Table", "options": "