From 7dc1fec27ca956355c3b630e8107538eeaafed2d Mon Sep 17 00:00:00 2001 From: Himanshu Date: Mon, 25 Mar 2019 11:43:08 +0530 Subject: [PATCH 001/103] feat(Naming Series): Option to Add field_value in Naming Series (#7027) To use field_value in naming_series, just add field_name in curly braces instead of the old naming convention which was kinda confusing and not easily understandable. eg: {field_name}.-.YYYY.-.MM.-.DD.-.#### --- frappe/core/doctype/doctype/doctype.json | 3890 +++++++++++----------- frappe/model/document.py | 2 +- frappe/model/naming.py | 22 +- 3 files changed, 1958 insertions(+), 1956 deletions(-) diff --git a/frappe/core/doctype/doctype/doctype.json b/frappe/core/doctype/doctype/doctype.json index 2d584eff5c..b6d3a83cf1 100644 --- a/frappe/core/doctype/doctype/doctype.json +++ b/frappe/core/doctype/doctype/doctype.json @@ -1,2078 +1,2078 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 1, - "autoname": "Prompt", - "beta": 0, - "creation": "2013-02-18 13:36:19", - "custom": 0, - "description": "DocType is a Table / Form in the application.", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 0, - "engine": "InnoDB", + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 1, + "autoname": "Prompt", + "beta": 0, + "creation": "2013-02-18 13:36:19", + "custom": 0, + "description": "DocType is a Table / Form in the application.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 0, + "engine": "InnoDB", "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "sb0", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sb0", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "module", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Module", - "length": 0, - "no_copy": 0, - "oldfieldname": "module", - "oldfieldtype": "Link", - "options": "Module Def", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "module", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Module", + "length": 0, + "no_copy": 0, + "oldfieldname": "module", + "oldfieldtype": "Link", + "options": "Module Def", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Child Tables are shown as a Grid in other DocTypes.", - "fieldname": "istable", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Is Child Table", - "length": 0, - "no_copy": 0, - "oldfieldname": "istable", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Child Tables are shown as a Grid in other DocTypes.", + "fieldname": "istable", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 1, + "label": "Is Child Table", + "length": 0, + "no_copy": 0, + "oldfieldname": "istable", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "description": "Single Types have only one record no tables associated. Values are stored in tabSingles", - "fieldname": "issingle", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Is Single", - "length": 0, - "no_copy": 0, - "oldfieldname": "issingle", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 1, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "description": "Single Types have only one record no tables associated. Values are stored in tabSingles", + "fieldname": "issingle", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 1, + "label": "Is Single", + "length": 0, + "no_copy": 0, + "oldfieldname": "issingle", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 1, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "depends_on": "istable", - "fieldname": "editable_grid", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Editable Grid", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "depends_on": "istable", + "fieldname": "editable_grid", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Editable Grid", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "cb01", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb01", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "depends_on": "eval:!doc.istable && !doc.issingle", - "fieldname": "quick_entry", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Quick Entry", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "depends_on": "eval:!doc.istable && !doc.issingle", + "fieldname": "quick_entry", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Quick Entry", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "depends_on": "eval:!doc.istable", - "fieldname": "track_changes", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Track Changes", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "depends_on": "eval:!doc.istable", + "fieldname": "track_changes", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Track Changes", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "custom", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Custom?", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "custom", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Custom?", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "beta", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Beta", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "beta", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Beta", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "track_views", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Track Views", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "track_views", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Track Views", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "depends_on": "eval: doc.image_field", - "fieldname": "image_view", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image View", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "depends_on": "eval: doc.image_field", + "fieldname": "image_view", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "app", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "App", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "app", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "App", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "fields_section_break", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Fields", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "fields_section_break", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Fields", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "fields", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Fields", - "length": 0, - "no_copy": 0, - "oldfieldname": "fields", - "oldfieldtype": "Table", - "options": "DocField", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "fields", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Fields", + "length": 0, + "no_copy": 0, + "oldfieldname": "fields", + "oldfieldtype": "Table", + "options": "DocField", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "sb1", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Naming", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sb1", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Naming", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Naming Options:\n
  1. field:[fieldname] - By Field
  2. naming_series: - By Naming Series (field called naming_series must be present
  3. Prompt - Prompt user for a name
  4. [series] - Series by prefix (separated by a dot); for example PRE.#####
  5. \n
  6. format:EXAMPLE-{MM}morewords{fieldname1}-{fieldname2}-{#####} - Replace all braced words (fieldnames, date words (DD, MM, YY), series) with their value. Outside braces, any characters can be used.
", - "fieldname": "autoname", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Auto Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "autoname", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Naming Options:\n
  1. field:[fieldname] - By Field
  2. naming_series: - By Naming Series (field called naming_series must be present)
  3. Prompt - Prompt user for a name
  4. [series] - Series by prefix (separated by a dot); for example PRE.#####
  5. \n
  6. format:EXAMPLE-{MM}morewords{fieldname1}-{fieldname2}-{#####} - Replace all braced words (fieldnames, date words (DD, MM, YY), series) with their value. Outside braces, any characters can be used.
", + "fieldname": "autoname", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Auto Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "autoname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "name_case", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Name Case", - "length": 0, - "no_copy": 0, - "oldfieldname": "name_case", - "oldfieldtype": "Select", - "options": "\nTitle Case\nUPPER CASE", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "name_case", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Name Case", + "length": 0, + "no_copy": 0, + "oldfieldname": "name_case", + "oldfieldtype": "Select", + "options": "\nTitle Case\nUPPER CASE", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "column_break_15", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "column_break_15", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "description", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "view_settings", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "View Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "view_settings", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "View Settings", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "description": "", - "fieldname": "title_field", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Title Field", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "description": "", + "fieldname": "title_field", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Title Field", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "fieldname": "search_fields", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Search Fields", - "length": 0, - "no_copy": 0, - "oldfieldname": "search_fields", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "fieldname": "search_fields", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Search Fields", + "length": 0, + "no_copy": 0, + "oldfieldname": "search_fields", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fieldname": "image_field", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image Field (Must of type \"Attach Image\")", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "", + "fieldname": "image_field", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image Field (Must of type \"Attach Image\")", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "description": "Comments and Communications will be associated with this linked document", - "fieldname": "timeline_field", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Timeline Field", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "description": "Comments and Communications will be associated with this linked document", + "fieldname": "timeline_field", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Timeline Field", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_events_in_timeline", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow events in timeline", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "allow_events_in_timeline", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow events in timeline", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_29", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_29", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fieldname": "document_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show in Module Section", - "length": 0, - "no_copy": 0, - "oldfieldname": "document_type", - "oldfieldtype": "Select", - "options": "\nDocument\nSetup\nSystem\nOther", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "", + "fieldname": "document_type", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Show in Module Section", + "length": 0, + "no_copy": 0, + "oldfieldname": "document_type", + "oldfieldtype": "Select", + "options": "\nDocument\nSetup\nSystem\nOther", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "restrict_to_domain", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Restrict To Domain", - "length": 0, - "no_copy": 0, - "options": "Domain", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "restrict_to_domain", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Restrict To Domain", + "length": 0, + "no_copy": 0, + "options": "Domain", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "icon", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Icon", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "icon", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Icon", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "color", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Color", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "color", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Color", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "track_seen", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Track Seen", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "track_seen", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Track Seen", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "read_only_onload", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show Print First", - "length": 0, - "no_copy": 0, - "oldfieldname": "read_only_onload", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "read_only_onload", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Show Print First", + "length": 0, + "no_copy": 0, + "oldfieldname": "read_only_onload", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "hide_heading", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Hide Heading", - "length": 0, - "no_copy": 0, - "oldfieldname": "hide_heading", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "hide_heading", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Hide Heading", + "length": 0, + "no_copy": 0, + "oldfieldname": "hide_heading", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "hide_toolbar", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Hide Toolbar", - "length": 0, - "no_copy": 0, - "oldfieldname": "hide_toolbar", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "hide_toolbar", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Hide Toolbar", + "length": 0, + "no_copy": 0, + "oldfieldname": "hide_toolbar", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_copy", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Hide Copy", - "length": 0, - "no_copy": 0, - "oldfieldname": "allow_copy", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "allow_copy", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Hide Copy", + "length": 0, + "no_copy": 0, + "oldfieldname": "allow_copy", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "show_name_in_global_search", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Make \"name\" searchable in Global Search", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "show_name_in_global_search", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Make \"name\" searchable in Global Search", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "fieldname": "sb2", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Permission Rules", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "fieldname": "sb2", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Permission Rules", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "permissions", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Permissions", - "length": 0, - "no_copy": 0, - "oldfieldname": "permissions", - "oldfieldtype": "Table", - "options": "DocPerm", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "permissions", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Permissions", + "length": 0, + "no_copy": 0, + "oldfieldname": "permissions", + "oldfieldtype": "Table", + "options": "DocPerm", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.istable", - "fieldname": "sb3", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.istable", + "fieldname": "sb3", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "cb30", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Permissions Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb30", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Permissions Settings", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "is_submittable", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Submittable", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "is_submittable", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Submittable", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fieldname": "allow_import", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Import (via Data Import Tool)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "", + "fieldname": "allow_import", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Import (via Data Import Tool)", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_rename", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Rename", - "length": 0, - "no_copy": 0, - "oldfieldname": "allow_rename", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "allow_rename", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Rename", + "length": 0, + "no_copy": 0, + "oldfieldname": "allow_rename", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "cb31", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Other Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb31", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Other Settings", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "max_attachments", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Max Attachments", - "length": 0, - "no_copy": 0, - "oldfieldname": "max_attachments", - "oldfieldtype": "Int", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "max_attachments", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Max Attachments", + "length": 0, + "no_copy": 0, + "oldfieldname": "max_attachments", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "default_print_format", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Default Print Format", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "default_print_format", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Default Print Format", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "list_view_settings", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "List View Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "list_view_settings", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "List View Settings", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "modified", - "depends_on": "eval:!doc.istable", - "description": "", - "fieldname": "sort_field", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Sort Field", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "modified", + "depends_on": "eval:!doc.istable", + "description": "", + "fieldname": "sort_field", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Sort Field", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "DESC", - "depends_on": "eval:!doc.istable", - "fieldname": "sort_order", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Sort Order", - "length": 0, - "no_copy": 0, - "options": "ASC\nDESC", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "DESC", + "depends_on": "eval:!doc.istable", + "fieldname": "sort_order", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Sort Order", + "length": 0, + "no_copy": 0, + "options": "ASC\nDESC", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_47", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_47", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "read_only", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "User Cannot Search", - "length": 0, - "no_copy": 0, - "oldfieldname": "read_only", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "read_only", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "User Cannot Search", + "length": 0, + "no_copy": 0, + "oldfieldname": "read_only", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "in_create", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "User Cannot Create", - "length": 0, - "no_copy": 0, - "oldfieldname": "in_create", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "in_create", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "User Cannot Create", + "length": 0, + "no_copy": 0, + "oldfieldname": "in_create", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "web_view", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Web View", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "web_view", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Web View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "has_web_view", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Has Web View", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "has_web_view", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Has Web View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "depends_on": "has_web_view", - "fieldname": "allow_guest_to_view", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Guest to View", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "depends_on": "has_web_view", + "fieldname": "allow_guest_to_view", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Guest to View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_53", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_53", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "has_web_view", - "fieldname": "route", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Route", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "has_web_view", + "fieldname": "route", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Route", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "depends_on": "has_web_view", - "fieldname": "is_published_field", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Published Field", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "depends_on": "has_web_view", + "fieldname": "is_published_field", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Published Field", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "advanced", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Advanced", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "advanced", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Advanced", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "InnoDB", - "depends_on": "eval:!doc.issingle", - "fieldname": "engine", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Database Engine", - "length": 0, - "no_copy": 0, - "options": "InnoDB\nMyISAM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "InnoDB", + "depends_on": "eval:!doc.issingle", + "fieldname": "engine", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Database Engine", + "length": 0, + "no_copy": 0, + "options": "InnoDB\nMyISAM", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "fa fa-bolt", - "idx": 6, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-09-24 13:57:58.777786", - "modified_by": "chdecultot@dokos.io", - "module": "Core", - "name": "DocType", - "owner": "Administrator", + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "fa fa-bolt", + "idx": 6, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-09-24 13:57:58.777786", + "modified_by": "chdecultot@dokos.io", + "module": "Core", + "name": "DocType", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Administrator", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Administrator", + "set_user_permissions": 0, + "share": 1, + "submit": 0, "write": 1 } - ], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "search_fields": "module", - "show_name_in_global_search": 1, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0, + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "search_fields": "module", + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, "track_views": 0 } \ No newline at end of file diff --git a/frappe/model/document.py b/frappe/model/document.py index 7e52137942..1d14079866 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -213,12 +213,12 @@ class Document(BaseDocument): self.set_docstatus() self.check_if_latest() self.run_method("before_insert") + self._validate_links() self.set_new_name() self.set_parent_in_children() self.validate_higher_perm_levels() self.flags.in_insert = True - self._validate_links() self.run_before_save_methods() self._validate() self.set_docstatus() diff --git a/frappe/model/naming.py b/frappe/model/naming.py index f5b00085fd..648e3689f3 100644 --- a/frappe/model/naming.py +++ b/frappe/model/naming.py @@ -88,21 +88,21 @@ def set_name_by_naming_series(doc): def make_autoname(key='', doctype='', doc=''): """ - Creates an autoname from the given key: + Creates an autoname from the given key: - **Autoname rules:** + **Autoname rules:** - * The key is separated by '.' - * '####' represents a series. The string before this part becomes the prefix: - Example: ABC.#### creates a series ABC0001, ABC0002 etc - * 'MM' represents the current month - * 'YY' and 'YYYY' represent the current year + * The key is separated by '.' + * '####' represents a series. The string before this part becomes the prefix: + Example: ABC.#### creates a series ABC0001, ABC0002 etc + * 'MM' represents the current month + * 'YY' and 'YYYY' represent the current year *Example:* - * DE/./.YY./.MM./.##### will create a series like - DE/09/01/0001 where 09 is the year, 01 is the month and 0001 is the series + * DE/./.YY./.MM./.##### will create a series like + DE/09/01/0001 where 09 is the year, 01 is the month and 0001 is the series """ if key == "hash": return frappe.generate_hash(doctype, 10) @@ -121,7 +121,6 @@ def parse_naming_series(parts, doctype='', doc=''): n = '' if isinstance(parts, string_types): parts = parts.split('.') - series_set = False today = now_datetime() for e in parts: @@ -141,6 +140,9 @@ def parse_naming_series(parts, doctype='', doc=''): part = today.strftime('%Y') elif e == 'FY': part = frappe.defaults.get_user_default("fiscal_year") + elif e.startswith('{') and doc: + e = e.replace('{', '').replace('}', '') + part = doc.get(e) elif doc and doc.get(e): part = doc.get(e) else: From 762813a076dfcf6a8251ceae7443ae35357f7cdd Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 8 Jan 2019 23:05:45 +0530 Subject: [PATCH 002/103] feat(dashboard): Create Dashboard page --- frappe/core/page/dashboard/__init__.py | 0 frappe/core/page/dashboard/dashboard.js | 29 +++++++++++++++++++++++ frappe/core/page/dashboard/dashboard.json | 19 +++++++++++++++ frappe/core/page/dashboard/dashboard.py | 10 ++++++++ 4 files changed, 58 insertions(+) create mode 100644 frappe/core/page/dashboard/__init__.py create mode 100644 frappe/core/page/dashboard/dashboard.js create mode 100644 frappe/core/page/dashboard/dashboard.json create mode 100644 frappe/core/page/dashboard/dashboard.py diff --git a/frappe/core/page/dashboard/__init__.py b/frappe/core/page/dashboard/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js new file mode 100644 index 0000000000..d22584b9ba --- /dev/null +++ b/frappe/core/page/dashboard/dashboard.js @@ -0,0 +1,29 @@ +frappe.pages['dashboard'].on_page_load = function(wrapper) { + var page = frappe.ui.make_app_page({ + parent: wrapper, + title: 'Dashboard', + single_column: true + }); + + $(`
+
+
`).appendTo(this.page.main); + + frappe.call({ + method: "frappe.core.page.dashboard.dashboard.get_data", + args: { + dashboard_name: "erpnext.accounts.dashboard.get", + }, + callback: function(message) { + const data = message.message + var chart_args = { + data: { + datasets: data.datasets, + labels: data.labels, + }, + type: 'line', + } + new Chart('.dashboard-graph', chart_args) + } + }) +} \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.json b/frappe/core/page/dashboard/dashboard.json new file mode 100644 index 0000000000..891dcb26f8 --- /dev/null +++ b/frappe/core/page/dashboard/dashboard.json @@ -0,0 +1,19 @@ +{ + "content": null, + "creation": "2019-01-08 19:19:48.073410", + "docstatus": 0, + "doctype": "Page", + "idx": 0, + "modified": "2019-01-08 19:19:48.073410", + "modified_by": "Administrator", + "module": "Core", + "name": "dashboard", + "owner": "Administrator", + "page_name": "Dashboard", + "roles": [], + "script": null, + "standard": "Yes", + "style": null, + "system_page": 0, + "title": "Dashboard" +} \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.py b/frappe/core/page/dashboard/dashboard.py new file mode 100644 index 0000000000..f954dee751 --- /dev/null +++ b/frappe/core/page/dashboard/dashboard.py @@ -0,0 +1,10 @@ +# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors +# MIT License. See license.txt +from __future__ import unicode_literals +import frappe + + +@frappe.whitelist() +def get_data(dashboard_name): + results = frappe.get_attr(dashboard_name)() + return results From 8840a179991caafcbd9a70bd853ad1b057dce063 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 9 Jan 2019 11:19:08 +0530 Subject: [PATCH 003/103] feat(dashboard): Add timespan filter --- frappe/core/page/dashboard/dashboard.js | 59 +++++++++++++++++-------- frappe/core/page/dashboard/dashboard.py | 6 ++- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index d22584b9ba..859f0b52c6 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -1,29 +1,50 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { + var me = this var page = frappe.ui.make_app_page({ parent: wrapper, title: 'Dashboard', single_column: true - }); + }) $(`
-
-
`).appendTo(this.page.main); +
+ `).appendTo(this.page.main) - frappe.call({ - method: "frappe.core.page.dashboard.dashboard.get_data", - args: { - dashboard_name: "erpnext.accounts.dashboard.get", - }, - callback: function(message) { - const data = message.message - var chart_args = { - data: { - datasets: data.datasets, - labels: data.labels, - }, - type: 'line', + this.timespans = ["Last Week", "Last Month", "Last Quarter", "Last Year"]; + this.filters = { + timespan: "Week", + } + this.timespan_select = this.page.add_select(__("Timespan"), + this.timespans.map(d => { + return {"label": __(d), value: d } + }) + ) + + this.timespan_select.on("change", function() { + me.filters.timespan = this.value + me.create_chart() + }); + + this.create_chart = function() { + frappe.call({ + method: "frappe.core.page.dashboard.dashboard.get_data", + args: { + dashboard_name: "erpnext.accounts.dashboard.get", + filters: this.filters, + }, + callback: function(message) { + const data = message.message + var chart_args = { + data: { + datasets: data.datasets, + labels: data.labels, + }, + type: 'line', + } + new Chart('#dashboard-graph', chart_args) } - new Chart('.dashboard-graph', chart_args) - } - }) + }) + } + + this.create_chart() } \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.py b/frappe/core/page/dashboard/dashboard.py index f954dee751..a3f26bb7df 100644 --- a/frappe/core/page/dashboard/dashboard.py +++ b/frappe/core/page/dashboard/dashboard.py @@ -1,10 +1,12 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals +import json import frappe @frappe.whitelist() -def get_data(dashboard_name): - results = frappe.get_attr(dashboard_name)() +def get_data(dashboard_name, filters=None): + filters = json.loads(filters) + results = frappe.get_attr(dashboard_name)(filters=frappe._dict(filters)) return results From 4f247a0ed551576a027f04a435ad9e306c734abe Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 9 Jan 2019 12:51:24 +0530 Subject: [PATCH 004/103] feat(dashboard): Add Time Grain filter --- frappe/core/page/dashboard/dashboard.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 859f0b52c6..e8917514eb 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -11,20 +11,33 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { `).appendTo(this.page.main) this.timespans = ["Last Week", "Last Month", "Last Quarter", "Last Year"]; + this.timegrains = ["Daily", "Weekly", "Monthly", "Quarterly"]; this.filters = { - timespan: "Week", + timespan: "Last Week", + timegrain: "Daily", } - this.timespan_select = this.page.add_select(__("Timespan"), + this.timespan_select = this.page.add_select(__("Time Span"), this.timespans.map(d => { return {"label": __(d), value: d } }) ) + this.timegrain_select = this.page.add_select(__("Time Grain"), + this.timegrains.map(d => { + return {"label": __(d), value: d } + }) + ) + this.timespan_select.on("change", function() { me.filters.timespan = this.value me.create_chart() }); + this.timegrain_select.on("change", function() { + me.filters.timegrain = this.value + me.create_chart() + }); + this.create_chart = function() { frappe.call({ method: "frappe.core.page.dashboard.dashboard.get_data", From 94c474072921061c57355c010ffbcb3cd6feefd4 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 10 Jan 2019 12:22:32 +0530 Subject: [PATCH 005/103] feat(dashbard): Set account from filters --- frappe/core/page/dashboard/dashboard.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index e8917514eb..76f43118fc 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -15,7 +15,22 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { this.filters = { timespan: "Last Week", timegrain: "Daily", + account: "Cash - GTPL", } + + this.account_select = this.page.add_field({ + fieldname: "account", + label: __("Account"), + fieldtype: "Link", + options: "Account", + get_query: { + doctype: "Account", + filters: { + company: "Gadget Technologies Pvt. Ltd.", + } + } + }).$wrapper.find("input") + this.timespan_select = this.page.add_select(__("Time Span"), this.timespans.map(d => { return {"label": __(d), value: d } @@ -27,6 +42,10 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { return {"label": __(d), value: d } }) ) + this.account_select.on("change", function() { + me.filters.account = this.value + me.create_chart() + }); this.timespan_select.on("change", function() { me.filters.timespan = this.value From 6d404c881e6e1ffc1fb665237cce58ddf8a24e32 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 10 Jan 2019 12:49:58 +0530 Subject: [PATCH 006/103] feat(dashboard): Create chart DocType --- frappe/core/doctype/chart/__init__.py | 0 frappe/core/doctype/chart/chart.js | 8 + frappe/core/doctype/chart/chart.json | 193 ++++++++++++++++++++++++ frappe/core/doctype/chart/chart.py | 10 ++ frappe/core/doctype/chart/test_chart.py | 10 ++ 5 files changed, 221 insertions(+) create mode 100644 frappe/core/doctype/chart/__init__.py create mode 100644 frappe/core/doctype/chart/chart.js create mode 100644 frappe/core/doctype/chart/chart.json create mode 100644 frappe/core/doctype/chart/chart.py create mode 100644 frappe/core/doctype/chart/test_chart.py diff --git a/frappe/core/doctype/chart/__init__.py b/frappe/core/doctype/chart/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/core/doctype/chart/chart.js b/frappe/core/doctype/chart/chart.js new file mode 100644 index 0000000000..70d191d079 --- /dev/null +++ b/frappe/core/doctype/chart/chart.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Frappe Technologies and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Chart', { + refresh: function(frm) { + + } +}); diff --git a/frappe/core/doctype/chart/chart.json b/frappe/core/doctype/chart/chart.json new file mode 100644 index 0000000000..267e6ad671 --- /dev/null +++ b/frappe/core/doctype/chart/chart.json @@ -0,0 +1,193 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2019-01-10 12:28:06.282875", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Chart Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_path", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Chart Path", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_type", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Chart Type", + "length": 0, + "no_copy": 0, + "options": "Line\nBar", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_filters_json", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Filters JSON", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-10 12:47:50.709263", + "modified_by": "Administrator", + "module": "Core", + "name": "Chart", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "chart_name", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/frappe/core/doctype/chart/chart.py b/frappe/core/doctype/chart/chart.py new file mode 100644 index 0000000000..28ba6ba42b --- /dev/null +++ b/frappe/core/doctype/chart/chart.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class Chart(Document): + pass diff --git a/frappe/core/doctype/chart/test_chart.py b/frappe/core/doctype/chart/test_chart.py new file mode 100644 index 0000000000..773e956f7b --- /dev/null +++ b/frappe/core/doctype/chart/test_chart.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestChart(unittest.TestCase): + pass From 529536da219869676686a4f9facdd9e2b03dd552 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 10 Jan 2019 12:57:43 +0530 Subject: [PATCH 007/103] feat(dashboard): Create Dashboard DocType --- frappe/core/doctype/dashboard/__init__.py | 0 frappe/core/doctype/dashboard/dashboard.js | 8 ++ frappe/core/doctype/dashboard/dashboard.json | 129 ++++++++++++++++++ frappe/core/doctype/dashboard/dashboard.py | 10 ++ .../core/doctype/dashboard/test_dashboard.py | 10 ++ 5 files changed, 157 insertions(+) create mode 100644 frappe/core/doctype/dashboard/__init__.py create mode 100644 frappe/core/doctype/dashboard/dashboard.js create mode 100644 frappe/core/doctype/dashboard/dashboard.json create mode 100644 frappe/core/doctype/dashboard/dashboard.py create mode 100644 frappe/core/doctype/dashboard/test_dashboard.py diff --git a/frappe/core/doctype/dashboard/__init__.py b/frappe/core/doctype/dashboard/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/core/doctype/dashboard/dashboard.js b/frappe/core/doctype/dashboard/dashboard.js new file mode 100644 index 0000000000..2757332f42 --- /dev/null +++ b/frappe/core/doctype/dashboard/dashboard.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Frappe Technologies and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Dashboard', { + refresh: function(frm) { + + } +}); diff --git a/frappe/core/doctype/dashboard/dashboard.json b/frappe/core/doctype/dashboard/dashboard.json new file mode 100644 index 0000000000..8a81fd7c87 --- /dev/null +++ b/frappe/core/doctype/dashboard/dashboard.json @@ -0,0 +1,129 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2019-01-10 12:54:40.938705", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "dashboard_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Dashboard Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "charts", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Charts", + "length": 0, + "no_copy": 0, + "options": "Chart", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-10 12:54:40.938705", + "modified_by": "Administrator", + "module": "Core", + "name": "Dashboard", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "dashboard_name", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/frappe/core/doctype/dashboard/dashboard.py b/frappe/core/doctype/dashboard/dashboard.py new file mode 100644 index 0000000000..acaeb5dc67 --- /dev/null +++ b/frappe/core/doctype/dashboard/dashboard.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class Dashboard(Document): + pass diff --git a/frappe/core/doctype/dashboard/test_dashboard.py b/frappe/core/doctype/dashboard/test_dashboard.py new file mode 100644 index 0000000000..ac56d00642 --- /dev/null +++ b/frappe/core/doctype/dashboard/test_dashboard.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestDashboard(unittest.TestCase): + pass From 12dc6c8bb6ae07918598d5e84c50ac138be60ccd Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:00:41 +0530 Subject: [PATCH 008/103] fix(dashboard): Use valid chart type in chart options --- frappe/core/doctype/chart/chart.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/chart/chart.json b/frappe/core/doctype/chart/chart.json index 267e6ad671..74614ee097 100644 --- a/frappe/core/doctype/chart/chart.json +++ b/frappe/core/doctype/chart/chart.json @@ -96,7 +96,7 @@ "label": "Chart Type", "length": 0, "no_copy": 0, - "options": "Line\nBar", + "options": "line\nbar", "permlevel": 0, "precision": "", "print_hide": 0, @@ -153,7 +153,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-10 12:47:50.709263", + "modified": "2019-01-10 17:25:00.980022", "modified_by": "Administrator", "module": "Core", "name": "Chart", From 23ab8e64296d0ac244ab25cc8375bcf9176cd61b Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:02:04 +0530 Subject: [PATCH 009/103] fix(dashboard): Do not render single chart by default --- frappe/core/page/dashboard/dashboard.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 76f43118fc..0c485175fa 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -77,6 +77,4 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { } }) } - - this.create_chart() } \ No newline at end of file From 5e85c129c3ccd3461e572c7316652d2357273771 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:05:28 +0530 Subject: [PATCH 010/103] feat(dashboard): Render multiple charts from charts table --- frappe/core/page/dashboard/dashboard.js | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 0c485175fa..1168f4e22a 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -6,8 +6,23 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { single_column: true }) + this.route = frappe.get_route() + this.dashboard_name = this.route.slice(-1)[0] + this.dashboard_doc = null + frappe.model.with_doc('Dashboard', this.dashboard_name).then((doc) => { + this.dashboard_doc = doc + this.charts = this.dashboard_doc.charts + + this.charts.map((chart) => { + var id = `dashboard-chart-${chart.name}` + var chart_wrapper = $(`
`).appendTo($("#dashboard-graph")) + this.create_chart(`#${id}`, chart, JSON.parse(chart.chart_filters_json)) + }) + + }) + $(`
-
+
`).appendTo(this.page.main) this.timespans = ["Last Week", "Last Month", "Last Quarter", "Last Year"]; @@ -57,12 +72,12 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { me.create_chart() }); - this.create_chart = function() { + this.create_chart = function(wrapper, chart, filters) { frappe.call({ method: "frappe.core.page.dashboard.dashboard.get_data", args: { - dashboard_name: "erpnext.accounts.dashboard.get", - filters: this.filters, + dashboard_name: chart.chart_path, + filters: filters, }, callback: function(message) { const data = message.message @@ -71,9 +86,9 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { datasets: data.datasets, labels: data.labels, }, - type: 'line', + type: chart.chart_type, } - new Chart('#dashboard-graph', chart_args) + new Chart(wrapper, chart_args) } }) } From 0ad14c04d91a6597f7c87b3a9593ed6da26b7882 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:09:27 +0530 Subject: [PATCH 011/103] fix(dashboard): Change naming for Dashboard DocType --- frappe/core/doctype/dashboard/dashboard.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/dashboard/dashboard.json b/frappe/core/doctype/dashboard/dashboard.json index 8a81fd7c87..27ddd19a0f 100644 --- a/frappe/core/doctype/dashboard/dashboard.json +++ b/frappe/core/doctype/dashboard/dashboard.json @@ -4,6 +4,7 @@ "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, + "autoname": "field:dashboard_name", "beta": 0, "creation": "2019-01-10 12:54:40.938705", "custom": 0, @@ -43,7 +44,7 @@ "search_index": 0, "set_only_once": 0, "translatable": 0, - "unique": 0 + "unique": 1 }, { "allow_bulk_edit": 0, @@ -89,7 +90,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-10 12:54:40.938705", + "modified": "2019-01-15 12:06:10.126944", "modified_by": "Administrator", "module": "Core", "name": "Dashboard", From 7b7c7b1dc91a5db5598368cb3451c5d5a3eff26b Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:14:43 +0530 Subject: [PATCH 012/103] feat(dashboard): Set dashboard name as page title --- frappe/core/page/dashboard/dashboard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 1168f4e22a..9d71c8830f 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -1,14 +1,16 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { var me = this - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: 'Dashboard', - single_column: true - }) this.route = frappe.get_route() this.dashboard_name = this.route.slice(-1)[0] this.dashboard_doc = null + + var page = frappe.ui.make_app_page({ + parent: wrapper, + title: this.dashboard_name, + single_column: true + }) + frappe.model.with_doc('Dashboard', this.dashboard_name).then((doc) => { this.dashboard_doc = doc this.charts = this.dashboard_doc.charts From f82a991949a6b8cce01f6796798208d83e08912b Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:35:08 +0530 Subject: [PATCH 013/103] feat(dashboard): Add Show Dashboard button --- frappe/core/doctype/dashboard/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/dashboard/dashboard.js b/frappe/core/doctype/dashboard/dashboard.js index 2757332f42..1e4e73e482 100644 --- a/frappe/core/doctype/dashboard/dashboard.js +++ b/frappe/core/doctype/dashboard/dashboard.js @@ -3,6 +3,6 @@ frappe.ui.form.on('Dashboard', { refresh: function(frm) { - + frm.add_custom_button("Show Dashboard", () => frappe.set_route('dashboard', frm.doc.name)) } }); From aa3a0a89dd8406bfc2add0dfbd4e5a06f4986785 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:35:45 +0530 Subject: [PATCH 014/103] feat(dashboard): Translate Show Dashboard button label --- frappe/core/doctype/dashboard/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/dashboard/dashboard.js b/frappe/core/doctype/dashboard/dashboard.js index 1e4e73e482..9bcd8cf981 100644 --- a/frappe/core/doctype/dashboard/dashboard.js +++ b/frappe/core/doctype/dashboard/dashboard.js @@ -3,6 +3,6 @@ frappe.ui.form.on('Dashboard', { refresh: function(frm) { - frm.add_custom_button("Show Dashboard", () => frappe.set_route('dashboard', frm.doc.name)) + frm.add_custom_button(__("Show Dashboard"), () => frappe.set_route('dashboard', frm.doc.name)) } }); From 82bb567ace99add58c20cc394a720246953fafa0 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 12:47:05 +0530 Subject: [PATCH 015/103] fix(dashboard): Remove global filters --- frappe/core/page/dashboard/dashboard.js | 47 ------------------------- 1 file changed, 47 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 9d71c8830f..37cf8620b7 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -27,53 +27,6 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) {
`).appendTo(this.page.main) - this.timespans = ["Last Week", "Last Month", "Last Quarter", "Last Year"]; - this.timegrains = ["Daily", "Weekly", "Monthly", "Quarterly"]; - this.filters = { - timespan: "Last Week", - timegrain: "Daily", - account: "Cash - GTPL", - } - - this.account_select = this.page.add_field({ - fieldname: "account", - label: __("Account"), - fieldtype: "Link", - options: "Account", - get_query: { - doctype: "Account", - filters: { - company: "Gadget Technologies Pvt. Ltd.", - } - } - }).$wrapper.find("input") - - this.timespan_select = this.page.add_select(__("Time Span"), - this.timespans.map(d => { - return {"label": __(d), value: d } - }) - ) - - this.timegrain_select = this.page.add_select(__("Time Grain"), - this.timegrains.map(d => { - return {"label": __(d), value: d } - }) - ) - this.account_select.on("change", function() { - me.filters.account = this.value - me.create_chart() - }); - - this.timespan_select.on("change", function() { - me.filters.timespan = this.value - me.create_chart() - }); - - this.timegrain_select.on("change", function() { - me.filters.timegrain = this.value - me.create_chart() - }); - this.create_chart = function(wrapper, chart, filters) { frappe.call({ method: "frappe.core.page.dashboard.dashboard.get_data", From de24979f305ee748b1b57c35987259e32c5f4b8d Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 13:12:55 +0530 Subject: [PATCH 016/103] feat(dashboard): Set chart_name as chart title --- frappe/core/page/dashboard/dashboard.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 37cf8620b7..586a2dbc19 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -37,6 +37,7 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { callback: function(message) { const data = message.message var chart_args = { + title: chart.chart_name, data: { datasets: data.datasets, labels: data.labels, From 9dd0dde020e5af4b81c73deedad4d98e99e3df6b Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 13:13:31 +0530 Subject: [PATCH 017/103] rafactor(dashboard): Use capitalized names in chart type --- frappe/core/doctype/chart/chart.json | 4 ++-- frappe/core/page/dashboard/dashboard.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/chart/chart.json b/frappe/core/doctype/chart/chart.json index 74614ee097..dc130dbcb9 100644 --- a/frappe/core/doctype/chart/chart.json +++ b/frappe/core/doctype/chart/chart.json @@ -96,7 +96,7 @@ "label": "Chart Type", "length": 0, "no_copy": 0, - "options": "line\nbar", + "options": "Line\nBar", "permlevel": 0, "precision": "", "print_hide": 0, @@ -153,7 +153,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-10 17:25:00.980022", + "modified": "2019-01-15 13:06:10.149493", "modified_by": "Administrator", "module": "Core", "name": "Chart", diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 586a2dbc19..76abb95e4d 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -35,6 +35,10 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { filters: filters, }, callback: function(message) { + const chart_type_map = { + "Line": "line", + "Bar": "bar", + } const data = message.message var chart_args = { title: chart.chart_name, @@ -42,7 +46,7 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { datasets: data.datasets, labels: data.labels, }, - type: chart.chart_type, + type: chart_type_map[chart.chart_type], } new Chart(wrapper, chart_args) } From 95b501030f79dff8dd673db9f6cfb2e3e214dc3a Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 14:32:00 +0530 Subject: [PATCH 018/103] fix(dashboard): Change fieldtype Chart Filters to Code --- frappe/core/doctype/chart/chart.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/chart/chart.json b/frappe/core/doctype/chart/chart.json index dc130dbcb9..d3fbe031f5 100644 --- a/frappe/core/doctype/chart/chart.json +++ b/frappe/core/doctype/chart/chart.json @@ -118,7 +118,7 @@ "collapsible": 0, "columns": 0, "fieldname": "chart_filters_json", - "fieldtype": "Data", + "fieldtype": "Code", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -153,7 +153,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-15 13:06:10.149493", + "modified": "2019-01-15 14:23:32.211219", "modified_by": "Administrator", "module": "Core", "name": "Chart", From 59ca8942314e76e21919a560567224e8ca73ab4d Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 15 Jan 2019 14:50:31 +0530 Subject: [PATCH 019/103] feat(dashboard): Configurable chart width --- frappe/core/doctype/chart/chart.json | 35 ++++++++++++++++++++++++- frappe/core/page/dashboard/dashboard.js | 10 ++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/chart/chart.json b/frappe/core/doctype/chart/chart.json index d3fbe031f5..7b6751e116 100644 --- a/frappe/core/doctype/chart/chart.json +++ b/frappe/core/doctype/chart/chart.json @@ -141,6 +141,39 @@ "set_only_once": 0, "translatable": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_width", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Chart Width", + "length": 0, + "no_copy": 0, + "options": "Half\nFull", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 } ], "has_web_view": 0, @@ -153,7 +186,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-15 14:23:32.211219", + "modified": "2019-01-15 14:46:06.870884", "modified_by": "Administrator", "module": "Core", "name": "Chart", diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 76abb95e4d..a0965fc794 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -17,7 +17,15 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { this.charts.map((chart) => { var id = `dashboard-chart-${chart.name}` - var chart_wrapper = $(`
`).appendTo($("#dashboard-graph")) + + const column_width_map = { + "Half": "6", + "Full": "12", + } + var columns = column_width_map[chart.chart_width] + var chart_wrapper = $(`
`) + chart_wrapper.appendTo($("#dashboard-graph")) + this.create_chart(`#${id}`, chart, JSON.parse(chart.chart_filters_json)) }) From 241d13743fd4d86da2d5cec2d140a0b7e509b734 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 13:39:55 +0530 Subject: [PATCH 020/103] refactor(dashboard): Move DocTypes to Desk module - Rename Chart to Dashboard Chart --- .../doctype/chart => desk/doctype/dashboard}/__init__.py | 0 frappe/{core => desk}/doctype/dashboard/dashboard.js | 0 frappe/{core => desk}/doctype/dashboard/dashboard.json | 6 +++--- frappe/{core => desk}/doctype/dashboard/dashboard.py | 0 frappe/{core => desk}/doctype/dashboard/test_dashboard.py | 0 .../dashboard => desk/doctype/dashboard_chart}/__init__.py | 0 .../doctype/dashboard_chart/dashboard_chart.js} | 2 +- .../doctype/dashboard_chart/dashboard_chart.json} | 6 +++--- .../doctype/dashboard_chart/dashboard_chart.py} | 2 +- .../doctype/dashboard_chart/test_dashboard_chart.py} | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename frappe/{core/doctype/chart => desk/doctype/dashboard}/__init__.py (100%) rename frappe/{core => desk}/doctype/dashboard/dashboard.js (100%) rename frappe/{core => desk}/doctype/dashboard/dashboard.json (96%) rename frappe/{core => desk}/doctype/dashboard/dashboard.py (100%) rename frappe/{core => desk}/doctype/dashboard/test_dashboard.py (100%) rename frappe/{core/doctype/dashboard => desk/doctype/dashboard_chart}/__init__.py (100%) rename frappe/{core/doctype/chart/chart.js => desk/doctype/dashboard_chart/dashboard_chart.js} (78%) rename frappe/{core/doctype/chart/chart.json => desk/doctype/dashboard_chart/dashboard_chart.json} (98%) rename frappe/{core/doctype/chart/chart.py => desk/doctype/dashboard_chart/dashboard_chart.py} (88%) rename frappe/{core/doctype/chart/test_chart.py => desk/doctype/dashboard_chart/test_dashboard_chart.py} (79%) diff --git a/frappe/core/doctype/chart/__init__.py b/frappe/desk/doctype/dashboard/__init__.py similarity index 100% rename from frappe/core/doctype/chart/__init__.py rename to frappe/desk/doctype/dashboard/__init__.py diff --git a/frappe/core/doctype/dashboard/dashboard.js b/frappe/desk/doctype/dashboard/dashboard.js similarity index 100% rename from frappe/core/doctype/dashboard/dashboard.js rename to frappe/desk/doctype/dashboard/dashboard.js diff --git a/frappe/core/doctype/dashboard/dashboard.json b/frappe/desk/doctype/dashboard/dashboard.json similarity index 96% rename from frappe/core/doctype/dashboard/dashboard.json rename to frappe/desk/doctype/dashboard/dashboard.json index 27ddd19a0f..e7f2d73784 100644 --- a/frappe/core/doctype/dashboard/dashboard.json +++ b/frappe/desk/doctype/dashboard/dashboard.json @@ -65,7 +65,7 @@ "label": "Charts", "length": 0, "no_copy": 0, - "options": "Chart", + "options": "Dashboard Chart", "permlevel": 0, "precision": "", "print_hide": 0, @@ -90,9 +90,9 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-15 12:06:10.126944", + "modified": "2019-01-16 13:35:14.516114", "modified_by": "Administrator", - "module": "Core", + "module": "Desk", "name": "Dashboard", "name_case": "", "owner": "Administrator", diff --git a/frappe/core/doctype/dashboard/dashboard.py b/frappe/desk/doctype/dashboard/dashboard.py similarity index 100% rename from frappe/core/doctype/dashboard/dashboard.py rename to frappe/desk/doctype/dashboard/dashboard.py diff --git a/frappe/core/doctype/dashboard/test_dashboard.py b/frappe/desk/doctype/dashboard/test_dashboard.py similarity index 100% rename from frappe/core/doctype/dashboard/test_dashboard.py rename to frappe/desk/doctype/dashboard/test_dashboard.py diff --git a/frappe/core/doctype/dashboard/__init__.py b/frappe/desk/doctype/dashboard_chart/__init__.py similarity index 100% rename from frappe/core/doctype/dashboard/__init__.py rename to frappe/desk/doctype/dashboard_chart/__init__.py diff --git a/frappe/core/doctype/chart/chart.js b/frappe/desk/doctype/dashboard_chart/dashboard_chart.js similarity index 78% rename from frappe/core/doctype/chart/chart.js rename to frappe/desk/doctype/dashboard_chart/dashboard_chart.js index 70d191d079..ff84a0a976 100644 --- a/frappe/core/doctype/chart/chart.js +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.js @@ -1,7 +1,7 @@ // Copyright (c) 2019, Frappe Technologies and contributors // For license information, please see license.txt -frappe.ui.form.on('Chart', { +frappe.ui.form.on('Dashboard Chart', { refresh: function(frm) { } diff --git a/frappe/core/doctype/chart/chart.json b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json similarity index 98% rename from frappe/core/doctype/chart/chart.json rename to frappe/desk/doctype/dashboard_chart/dashboard_chart.json index 7b6751e116..8e267759e7 100644 --- a/frappe/core/doctype/chart/chart.json +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json @@ -186,10 +186,10 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-15 14:46:06.870884", + "modified": "2019-01-16 13:34:58.802451", "modified_by": "Administrator", - "module": "Core", - "name": "Chart", + "module": "Desk", + "name": "Dashboard Chart", "name_case": "", "owner": "Administrator", "permissions": [ diff --git a/frappe/core/doctype/chart/chart.py b/frappe/desk/doctype/dashboard_chart/dashboard_chart.py similarity index 88% rename from frappe/core/doctype/chart/chart.py rename to frappe/desk/doctype/dashboard_chart/dashboard_chart.py index 28ba6ba42b..99c6f9717f 100644 --- a/frappe/core/doctype/chart/chart.py +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.py @@ -6,5 +6,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class Chart(Document): +class DashboardChart(Document): pass diff --git a/frappe/core/doctype/chart/test_chart.py b/frappe/desk/doctype/dashboard_chart/test_dashboard_chart.py similarity index 79% rename from frappe/core/doctype/chart/test_chart.py rename to frappe/desk/doctype/dashboard_chart/test_dashboard_chart.py index 773e956f7b..a9aa0b2263 100644 --- a/frappe/core/doctype/chart/test_chart.py +++ b/frappe/desk/doctype/dashboard_chart/test_dashboard_chart.py @@ -6,5 +6,5 @@ from __future__ import unicode_literals import frappe import unittest -class TestChart(unittest.TestCase): +class TestDashboardChart(unittest.TestCase): pass From 8028fef1961bb0df4aedd31053877ef75d70b176 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 14:19:31 +0530 Subject: [PATCH 021/103] refactor(dashboard): Refactor into Class --- frappe/core/page/dashboard/dashboard.js | 128 +++++++++++++++--------- 1 file changed, 78 insertions(+), 50 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index a0965fc794..9d2f1e5822 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -1,63 +1,91 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { - var me = this - this.route = frappe.get_route() - this.dashboard_name = this.route.slice(-1)[0] - this.dashboard_doc = null - var page = frappe.ui.make_app_page({ + let page = frappe.ui.make_app_page({ parent: wrapper, - title: this.dashboard_name, + title: __("Dashboard"), single_column: true }) - frappe.model.with_doc('Dashboard', this.dashboard_name).then((doc) => { - this.dashboard_doc = doc - this.charts = this.dashboard_doc.charts - - this.charts.map((chart) => { - var id = `dashboard-chart-${chart.name}` - - const column_width_map = { - "Half": "6", - "Full": "12", - } - var columns = column_width_map[chart.chart_width] - var chart_wrapper = $(`
`) - chart_wrapper.appendTo($("#dashboard-graph")) - - this.create_chart(`#${id}`, chart, JSON.parse(chart.chart_filters_json)) - }) - + frappe.dashboard = new Dashboard(wrapper) + $(wrapper).bind('show', function() { + frappe.dashboard.show() }) - $(`
-
-
`).appendTo(this.page.main) +} - this.create_chart = function(wrapper, chart, filters) { - frappe.call({ - method: "frappe.core.page.dashboard.dashboard.get_data", - args: { - dashboard_name: chart.chart_path, - filters: filters, - }, - callback: function(message) { - const chart_type_map = { - "Line": "line", - "Bar": "bar", - } - const data = message.message - var chart_args = { - title: chart.chart_name, - data: { - datasets: data.datasets, - labels: data.labels, - }, - type: chart_type_map[chart.chart_type], - } - new Chart(wrapper, chart_args) - } +class Dashboard { + constructor(wrapper) { + this.wrapper = $(wrapper) + $(`
+
+
`).appendTo(this.wrapper.find(".page-content").empty()) + this.container = this.wrapper.find(".dashboard-graph") + this.page = wrapper.page + } + + show() { + this.route = frappe.get_route() + const current_dashboard_name = this.route.slice(-1)[0] + + if(this.dashboard_name !== current_dashboard_name) { + this.dashboard_name = current_dashboard_name + this.page.set_title(this.dashboard_name) + this.refresh() + } + } + + refresh() { + this.get_dashboard_doc().then((doc) => { + this.dashboard_doc = doc + this.charts = this.dashboard_doc.charts + + this.charts.map((chart) => { + this.fetch_and_render_chart(chart); + }) }) } + + fetch_and_render_chart(chart) { + this.fetch_chart(chart).then((data) => this.render_chart(chart, data)) + } + + get_dashboard_doc() { + return frappe.model.with_doc('Dashboard', this.dashboard_name) + } + + fetch_chart(chart) { + return frappe.xcall( + "frappe.core.page.dashboard.dashboard.get_data", + { + dashboard_name: chart.chart_path, + filters: JSON.parse(chart.chart_filters_json), + } + ) + } + + render_chart(chart, data) { + const column_width_map = { + "Half": "6", + "Full": "12", + }; + let columns = column_width_map[chart.chart_width]; + let chart_container = $(`
`); + chart_container.appendTo(this.container); + + + const chart_type_map = { + "Line": "line", + "Bar": "bar", + }; + let chart_args = { + title: chart.chart_name, + data: { + datasets: data.datasets, + labels: data.labels, + }, + type: chart_type_map[chart.chart_type], + }; + new Chart(chart_container.find(".chart-wrapper")[0], chart_args); + } } \ No newline at end of file From 750540f625033ee3f53ad8d21938d8d82bc7fb1e Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 14:35:10 +0530 Subject: [PATCH 022/103] refactor(dashboard): Refactor field names --- .../dashboard_chart/dashboard_chart.json | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json index 8e267759e7..13f089d904 100644 --- a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json @@ -52,7 +52,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "chart_path", + "fieldname": "method_path", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, @@ -61,7 +61,7 @@ "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, - "label": "Chart Path", + "label": "Method Path", "length": 0, "no_copy": 0, "permlevel": 0, @@ -84,7 +84,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "chart_type", + "fieldname": "type", "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, @@ -93,7 +93,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Chart Type", + "label": "Type", "length": 0, "no_copy": 0, "options": "Line\nBar", @@ -117,7 +117,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "chart_filters_json", + "fieldname": "filters_json", "fieldtype": "Code", "hidden": 0, "ignore_user_permissions": 0, @@ -149,7 +149,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "chart_width", + "fieldname": "width", "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, @@ -158,7 +158,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Chart Width", + "label": "Width", "length": 0, "no_copy": 0, "options": "Half\nFull", @@ -174,6 +174,38 @@ "set_only_once": 0, "translatable": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "color", + "fieldtype": "Color", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Color", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 } ], "has_web_view": 0, @@ -186,7 +218,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-16 13:34:58.802451", + "modified": "2019-01-16 14:33:08.565174", "modified_by": "Administrator", "module": "Desk", "name": "Dashboard Chart", From 8f929e1390e0b1d18afa691510b43f0f0444bfb6 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 14:35:28 +0530 Subject: [PATCH 023/103] feat(dashboard): Add color and styling --- frappe/core/page/dashboard/dashboard.css | 6 ++++++ frappe/core/page/dashboard/dashboard.js | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 frappe/core/page/dashboard/dashboard.css diff --git a/frappe/core/page/dashboard/dashboard.css b/frappe/core/page/dashboard/dashboard.css new file mode 100644 index 0000000000..4bf25592f6 --- /dev/null +++ b/frappe/core/page/dashboard/dashboard.css @@ -0,0 +1,6 @@ +.chart-container { + border: 1px solid #d1d8dd; + border-radius: 4px; + margin: 15px 0; + padding: 15px; +} \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 9d2f1e5822..58c14ce350 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -58,8 +58,8 @@ class Dashboard { return frappe.xcall( "frappe.core.page.dashboard.dashboard.get_data", { - dashboard_name: chart.chart_path, - filters: JSON.parse(chart.chart_filters_json), + dashboard_name: chart.method_path, + filters: JSON.parse(chart.filters_json), } ) } @@ -69,7 +69,7 @@ class Dashboard { "Half": "6", "Full": "12", }; - let columns = column_width_map[chart.chart_width]; + let columns = column_width_map[chart.width]; let chart_container = $(`
`); chart_container.appendTo(this.container); @@ -84,7 +84,8 @@ class Dashboard { datasets: data.datasets, labels: data.labels, }, - type: chart_type_map[chart.chart_type], + type: chart_type_map[chart.type], + colors: [chart.color || "light-blue"], }; new Chart(chart_container.find(".chart-wrapper")[0], chart_args); } From 21ae89e721123043564495c19366d75776bb2618 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 15:54:41 +0530 Subject: [PATCH 024/103] feat(code-editor): Add JSON language for Code Editor --- frappe/public/js/frappe/form/controls/code.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/code.js b/frappe/public/js/frappe/form/controls/code.js index 9d6f705523..4e4a79201e 100644 --- a/frappe/public/js/frappe/form/controls/code.js +++ b/frappe/public/js/frappe/form/controls/code.js @@ -32,7 +32,8 @@ frappe.ui.form.ControlCode = frappe.ui.form.ControlText.extend({ 'HTML': 'ace/mode/html', 'CSS': 'ace/mode/css', 'Markdown': 'ace/mode/markdown', - 'SCSS': 'ace/mode/scss' + 'SCSS': 'ace/mode/scss', + 'JSON': 'ace/mode/json' }; const language = this.df.options; From cc0ea4f5ef6d2d88abaa5a44e646f1a16d9d8490 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 15:55:16 +0530 Subject: [PATCH 025/103] feat(dashboard): Add dropdown menu to set filters --- frappe/core/page/dashboard/dashboard.css | 10 +++++ frappe/core/page/dashboard/dashboard.js | 39 ++++++++++++++++++- .../dashboard_chart/dashboard_chart.json | 36 ++++++++++++++++- 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.css b/frappe/core/page/dashboard/dashboard.css index 4bf25592f6..66a7e8aa36 100644 --- a/frappe/core/page/dashboard/dashboard.css +++ b/frappe/core/page/dashboard/dashboard.css @@ -3,4 +3,14 @@ border-radius: 4px; margin: 15px 0; padding: 15px; +} + +.chart-actions { + position: absolute; + right: 30px; + top: 30px; +} + +.chart-column-container { + position: relative; } \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 58c14ce350..264498d30a 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -65,12 +65,49 @@ class Dashboard { } render_chart(chart, data) { + chart.filter_fields = JSON.parse(chart.filter_fields || '[]') + chart.filters_json = JSON.parse(chart.filters_json || '{}') + const column_width_map = { "Half": "6", "Full": "12", }; let columns = column_width_map[chart.width]; - let chart_container = $(`
`); + let actions = [ + { + label: __("More"), + action: "more", + handler() { + const d = new frappe.ui.Dialog({ + title: __('Set Filters'), + fields: chart.filter_fields + }) + d.set_values(chart.filters_json) + d.show(); + } + } + ] + + let chart_action = $(` + `); + + chart_action.find("a[data-action]").each((i, o) => { + const action = o.dataset.action + $(o).click(actions.find(a => a.action === action)) + }) + + + let chart_container = $(`
+
+
`); + chart_action.prependTo(chart_container) chart_container.appendTo(this.container); diff --git a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json index 13f089d904..b6ac598854 100644 --- a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json @@ -129,6 +129,7 @@ "label": "Filters JSON", "length": 0, "no_copy": 0, + "options": "JSON", "permlevel": 0, "precision": "", "print_hide": 0, @@ -206,6 +207,39 @@ "set_only_once": 0, "translatable": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "filter_fields", + "fieldtype": "Code", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Filter Fields", + "length": 0, + "no_copy": 0, + "options": "JSON", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 } ], "has_web_view": 0, @@ -218,7 +252,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-16 14:33:08.565174", + "modified": "2019-01-16 15:22:10.760396", "modified_by": "Administrator", "module": "Desk", "name": "Dashboard Chart", From 499ddf53927c1ce3d386c443a6b927cbaf5cb467 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 16:20:00 +0530 Subject: [PATCH 026/103] refactor(dashboard): Rename More to Set Filters --- frappe/core/page/dashboard/dashboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 264498d30a..e4f7b9c08e 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -75,8 +75,8 @@ class Dashboard { let columns = column_width_map[chart.width]; let actions = [ { - label: __("More"), - action: "more", + label: __("Set Filters"), + action: "set-filters", handler() { const d = new frappe.ui.Dialog({ title: __('Set Filters'), From f7f1aca59edf8a556abd64cf050cbfd74f67d58c Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 16:20:34 +0530 Subject: [PATCH 027/103] feat(dashboard): Add Refresh Chart button --- frappe/core/page/dashboard/dashboard.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index e4f7b9c08e..fe1a679969 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -85,6 +85,12 @@ class Dashboard { d.set_values(chart.filters_json) d.show(); } + }, + { + label: __("Refresh Chart"), + action: "refresh-chart", + handler() { + } } ] From 05da0a491602e7d57f45cb8810430e735f823e60 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 17:37:26 +0530 Subject: [PATCH 028/103] feat(dashboard): Cache results for Chart --- frappe/core/page/dashboard/dashboard.css | 7 ++++ frappe/core/page/dashboard/dashboard.js | 22 +++++++----- frappe/core/page/dashboard/dashboard.py | 26 ++++++++++++-- .../dashboard_chart/dashboard_chart.json | 34 ++++++++++++++++++- 4 files changed, 76 insertions(+), 13 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.css b/frappe/core/page/dashboard/dashboard.css index 66a7e8aa36..e998997f67 100644 --- a/frappe/core/page/dashboard/dashboard.css +++ b/frappe/core/page/dashboard/dashboard.css @@ -13,4 +13,11 @@ .chart-column-container { position: relative; +} + +.last-synced-text { + position: absolute; + top: 34px; + right: 60px; + font-size: 10px; } \ No newline at end of file diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index fe1a679969..5f53c41eea 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -33,6 +33,7 @@ class Dashboard { this.page.set_title(this.dashboard_name) this.refresh() } + this.charts = {} } refresh() { @@ -42,6 +43,8 @@ class Dashboard { this.charts.map((chart) => { this.fetch_and_render_chart(chart); + chart.filters_json = JSON.parse(chart.filters_json || '{}') + chart.filter_fields = JSON.parse(chart.filter_fields || '[]') }) }) } @@ -54,25 +57,23 @@ class Dashboard { return frappe.model.with_doc('Dashboard', this.dashboard_name) } - fetch_chart(chart) { + fetch_chart(chart, refresh=false) { return frappe.xcall( "frappe.core.page.dashboard.dashboard.get_data", { - dashboard_name: chart.method_path, - filters: JSON.parse(chart.filters_json), + chart_name: chart.name, + refresh: refresh, } ) } render_chart(chart, data) { - chart.filter_fields = JSON.parse(chart.filter_fields || '[]') - chart.filters_json = JSON.parse(chart.filters_json || '{}') - const column_width_map = { "Half": "6", "Full": "12", }; let columns = column_width_map[chart.width]; + var me = this let actions = [ { label: __("Set Filters"), @@ -87,13 +88,15 @@ class Dashboard { } }, { - label: __("Refresh Chart"), - action: "refresh-chart", + label: __("Force Refresh"), + action: "force-refresh", handler() { + me.fetch_chart(chart, true).then(data => {console.log(data);me.charts[chart.name].update(data)}) } } ] + let last_synced_text = $(`${__("Last synced {0}", [comment_when(chart.last_synced_on)])}`) let chart_action = $(`
- `); + // var me = this + // let actions = [ + // { + // label: __("Set Filters"), + // action: "set-filters", + // handler() { + // const d = new frappe.ui.Dialog({ + // title: __('Set Filters'), + // fields: chart.filter_fields, + // primary_action: function() { + // const values = this.get_values() + // if (!Object.entries(chart.filters_json).map(e => values[e[0]] === e[1]).every(Boolean)) { + // frappe.db.set_value("Dashboard Chart", chart.name, "filters_json", JSON.stringify(values)).then(() => { + // me.fetch_chart(chart).then(data => { + // me.charts[chart.name].update(data) + // }) + // }) + // } + // this.hide() + // }, + // primary_action_label: __('Save Filters') + // }) + // d.set_values(chart.filters_json) + // d.show(); + // } + // }, + // { + // label: __("Force Refresh"), + // action: "force-refresh", + // handler() { + // me.fetch_chart(chart, true).then(data => { + // me.charts[chart.name].update(data) + // }) + // } + // } + // ] - chart_action.find("a[data-action]").each((i, o) => { - const action = o.dataset.action - $(o).click(actions.find(a => a.action === action)) - }) + // let last_synced_text = $(`${__("Last synced {0}", [comment_when(chart.last_synced_on)])}`) + // let chart_action = $(` + // `); + + // chart_action.find("a[data-action]").each((i, o) => { + // const action = o.dataset.action + // $(o).click(actions.find(a => a.action === action)) + // }) - let chart_container = $(`
-
-
`); - chart_action.prependTo(chart_container) - last_synced_text.prependTo(chart_container) - chart_container.appendTo(this.container); + // chart_action.prependTo(chart_container) + // last_synced_text.prependTo(chart_container) const chart_type_map = { "Line": "line", "Bar": "bar", - }; + } let chart_args = { - title: chart.chart_name, + title: this.chart_doc.chart_name, data: { - datasets: data.datasets, - labels: data.labels, + datasets: this.data.datasets, + labels: this.data.labels, }, - type: chart_type_map[chart.type], - colors: [chart.color || "light-blue"], + type: chart_type_map[this.chart_doc.type], + colors: [this.chart_doc.color || "light-blue"], }; - this.charts[chart.name] = new Chart(chart_container.find(".chart-wrapper")[0], chart_args); + this.chart = new Chart(this.chart_container.find(".chart-wrapper")[0], chart_args); } + } \ No newline at end of file From ba23476141ecc65721291739c6158795a0d4432a Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 19:36:23 +0530 Subject: [PATCH 032/103] refactor(dashboard): Update last_synced_on on forced refresh --- frappe/core/page/dashboard/dashboard.js | 152 +++++++++++++----------- 1 file changed, 85 insertions(+), 67 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index d8c9e2930f..b5b3448214 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -63,9 +63,7 @@ class DashboardChart { } show() { - this.filters = JSON.parse(this.chart_doc.filters_json || '{}') - this.filter_fields = JSON.parse(this.chart_doc.filter_fields || '[]') - + this.prepare_chart_object() this.prepare_container() this.fetch().then((data) => { @@ -84,6 +82,66 @@ class DashboardChart {
`) this.chart_container.appendTo(this.container) + + let last_synced_text = $(``) + last_synced_text.prependTo(this.chart_container) + + let actions = [ + { + label: __("Set Filters"), + action: "set-filters", + handler: () => { + const d = new frappe.ui.Dialog({ + title: __('Set Filters'), + fields: this.filter_fields, + primary_action: () => { + const values = d.get_values() + if (!Object.entries(this.filters).map(e => values[e[0]] === e[1]).every(Boolean)) { + frappe.db.set_value("Dashboard Chart", this.chart_doc.name, "filters_json", JSON.stringify(values)).then(() => { + this.fetch().then(data => { + this.data = data + this.render() + }) + }) + } + d.hide() + }, + primary_action_label: __('Save Filters') + }) + d.set_values(this.filters) + d.show(); + } + }, + { + label: __("Force Refresh"), + action: "force-refresh", + handler: () => { + this.fetch(true).then(data => { + this.data = data + this.chart_doc.last_synced_on = new Date() + this.render() + }) + } + } + ] + + this.chart_actions = $(` + `); + + this.chart_actions.find("a[data-action]").each((i, o) => { + const action = o.dataset.action + $(o).click(actions.find(a => a.action === action)) + }) + + this.chart_actions.prependTo(this.chart_container) + } fetch(refresh=false) { @@ -97,79 +155,39 @@ class DashboardChart { } render() { - - // var me = this - // let actions = [ - // { - // label: __("Set Filters"), - // action: "set-filters", - // handler() { - // const d = new frappe.ui.Dialog({ - // title: __('Set Filters'), - // fields: chart.filter_fields, - // primary_action: function() { - // const values = this.get_values() - // if (!Object.entries(chart.filters_json).map(e => values[e[0]] === e[1]).every(Boolean)) { - // frappe.db.set_value("Dashboard Chart", chart.name, "filters_json", JSON.stringify(values)).then(() => { - // me.fetch_chart(chart).then(data => { - // me.charts[chart.name].update(data) - // }) - // }) - // } - // this.hide() - // }, - // primary_action_label: __('Save Filters') - // }) - // d.set_values(chart.filters_json) - // d.show(); - // } - // }, - // { - // label: __("Force Refresh"), - // action: "force-refresh", - // handler() { - // me.fetch_chart(chart, true).then(data => { - // me.charts[chart.name].update(data) - // }) - // } - // } - // ] - - // let last_synced_text = $(`${__("Last synced {0}", [comment_when(chart.last_synced_on)])}`) - // let chart_action = $(` - // `); - - // chart_action.find("a[data-action]").each((i, o) => { - // const action = o.dataset.action - // $(o).click(actions.find(a => a.action === action)) - // }) - - - - // chart_action.prependTo(chart_container) - // last_synced_text.prependTo(chart_container) - + this.update_last_synced() const chart_type_map = { "Line": "line", "Bar": "bar", } let chart_args = { title: this.chart_doc.chart_name, - data: { - datasets: this.data.datasets, - labels: this.data.labels, - }, + data: this.data, type: chart_type_map[this.chart_doc.type], colors: [this.chart_doc.color || "light-blue"], }; - this.chart = new Chart(this.chart_container.find(".chart-wrapper")[0], chart_args); + if(!this.chart) { + this.chart = new Chart(this.chart_container.find(".chart-wrapper")[0], chart_args); + } + else { + this.chart.update(this.data) + } } + update_last_synced() { + let last_synced_text = __("Last synced {0}", [comment_when(this.chart_doc.last_synced_on)]) + this.container.find(".last-synced-text").html(last_synced_text) + } + + update_chart_object() { + frappe.db.get_doc("Dashboard Chart", this.chart_doc.name).then(doc => { + this.chart_doc = doc + this.prepare_chart_object() + }) + } + + prepare_chart_object() { + this.filters = JSON.parse(this.chart_doc.filters_json || '{}') + this.filter_fields = JSON.parse(this.chart_doc.filter_fields || '[]') + } } \ No newline at end of file From 17d17f13621e152784fc20bda5b7575939ff92c8 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 20:02:29 +0530 Subject: [PATCH 033/103] fix(dashboard): Add missing semicolons --- frappe/core/page/dashboard/dashboard.js | 120 ++++++++++++------------ 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index b5b3448214..906020880f 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -5,86 +5,86 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { parent: wrapper, title: __("Dashboard"), single_column: true - }) + }); - frappe.dashboard = new Dashboard(wrapper) + frappe.dashboard = new Dashboard(wrapper); $(wrapper).bind('show', function() { - frappe.dashboard.show() - }) + frappe.dashboard.show(); + }); } class Dashboard { constructor(wrapper) { - this.wrapper = $(wrapper) + this.wrapper = $(wrapper); $(`
-
`).appendTo(this.wrapper.find(".page-content").empty()) - this.container = this.wrapper.find(".dashboard-graph") - this.page = wrapper.page +
`).appendTo(this.wrapper.find(".page-content").empty()); + this.container = this.wrapper.find(".dashboard-graph"); + this.page = wrapper.page; } show() { - this.route = frappe.get_route() - const current_dashboard_name = this.route.slice(-1)[0] + this.route = frappe.get_route(); + const current_dashboard_name = this.route.slice(-1)[0]; if(this.dashboard_name !== current_dashboard_name) { - this.dashboard_name = current_dashboard_name - this.page.set_title(this.dashboard_name) - this.refresh() + this.dashboard_name = current_dashboard_name; + this.page.set_title(this.dashboard_name); + this.refresh(); } - this.charts = {} + this.charts = {}; } refresh() { this.get_dashboard_doc().then((doc) => { - this.dashboard_doc = doc - this.charts = this.dashboard_doc.charts + this.dashboard_doc = doc; + this.charts = this.dashboard_doc.charts; this.charts.map((chart_doc) => { - let chart_container = $("
") - chart_container.appendTo(this.container) + let chart_container = $("
"); + chart_container.appendTo(this.container); - let dashboard_chart = new DashboardChart(chart_doc, chart_container) - dashboard_chart.show() - }) + let dashboard_chart = new DashboardChart(chart_doc, chart_container); + dashboard_chart.show(); + }); }) } get_dashboard_doc() { - return frappe.model.with_doc('Dashboard', this.dashboard_name) + return frappe.model.with_doc('Dashboard', this.dashboard_name); } } class DashboardChart { constructor(chart_doc, chart_container) { - this.chart_doc = chart_doc - this.container = chart_container + this.chart_doc = chart_doc; + this.container = chart_container; } show() { - this.prepare_chart_object() - this.prepare_container() + this.prepare_chart_object(); + this.prepare_container(); this.fetch().then((data) => { - this.data = data - this.render() - }) + this.data = data; + this.render(); + }); } prepare_container() { const column_width_map = { "Half": "6", "Full": "12", - } - let columns = column_width_map[this.chart_doc.width] + }; + let columns = column_width_map[this.chart_doc.width]; this.chart_container = $(`
-
`) - this.chart_container.appendTo(this.container) +
`); + this.chart_container.appendTo(this.container); - let last_synced_text = $(``) - last_synced_text.prependTo(this.chart_container) + let last_synced_text = $(``); + last_synced_text.prependTo(this.chart_container); let actions = [ { @@ -95,20 +95,20 @@ class DashboardChart { title: __('Set Filters'), fields: this.filter_fields, primary_action: () => { - const values = d.get_values() + const values = d.get_values(); if (!Object.entries(this.filters).map(e => values[e[0]] === e[1]).every(Boolean)) { frappe.db.set_value("Dashboard Chart", this.chart_doc.name, "filters_json", JSON.stringify(values)).then(() => { this.fetch().then(data => { - this.data = data - this.render() + this.data = data; + this.render(); }) - }) + }); } - d.hide() + d.hide(); }, - primary_action_label: __('Save Filters') + primary_action_label: __('Save Filters'); }) - d.set_values(this.filters) + d.set_values(this.filters); d.show(); } }, @@ -117,9 +117,9 @@ class DashboardChart { action: "force-refresh", handler: () => { this.fetch(true).then(data => { - this.data = data - this.chart_doc.last_synced_on = new Date() - this.render() + this.data = data; + this.chart_doc.last_synced_on = new Date(); + this.render(); }) } } @@ -136,11 +136,11 @@ class DashboardChart { `); this.chart_actions.find("a[data-action]").each((i, o) => { - const action = o.dataset.action - $(o).click(actions.find(a => a.action === action)) - }) + const action = o.dataset.action; + $(o).click(actions.find(a => a.action === action)); + }); - this.chart_actions.prependTo(this.chart_container) + this.chart_actions.prependTo(this.chart_container); } @@ -151,15 +151,15 @@ class DashboardChart { chart_name: this.chart_doc.name, refresh: refresh, } - ) + ); } render() { - this.update_last_synced() + this.update_last_synced(); const chart_type_map = { "Line": "line", "Bar": "bar", - } + }; let chart_args = { title: this.chart_doc.chart_name, data: this.data, @@ -170,24 +170,24 @@ class DashboardChart { this.chart = new Chart(this.chart_container.find(".chart-wrapper")[0], chart_args); } else { - this.chart.update(this.data) + this.chart.update(this.data); } } update_last_synced() { - let last_synced_text = __("Last synced {0}", [comment_when(this.chart_doc.last_synced_on)]) - this.container.find(".last-synced-text").html(last_synced_text) + let last_synced_text = __("Last synced {0}", [comment_when(this.chart_doc.last_synced_on)]); + this.container.find(".last-synced-text").html(last_synced_text); } update_chart_object() { frappe.db.get_doc("Dashboard Chart", this.chart_doc.name).then(doc => { - this.chart_doc = doc - this.prepare_chart_object() - }) + this.chart_doc = doc; + this.prepare_chart_object(); + }); } prepare_chart_object() { - this.filters = JSON.parse(this.chart_doc.filters_json || '{}') - this.filter_fields = JSON.parse(this.chart_doc.filter_fields || '[]') + this.filters = JSON.parse(this.chart_doc.filters_json || '{}'); + this.filter_fields = JSON.parse(this.chart_doc.filter_fields || '[]'); } } \ No newline at end of file From 277969ecfc1f2d58f7d964e33628c301bbe2476c Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 20:06:00 +0530 Subject: [PATCH 034/103] fix(dashboard: Remove empty lines --- frappe/core/page/dashboard/dashboard.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 906020880f..71f5b0361a 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -1,7 +1,5 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { - - - let page = frappe.ui.make_app_page({ + frappe.ui.make_app_page({ parent: wrapper, title: __("Dashboard"), single_column: true @@ -11,7 +9,6 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { $(wrapper).bind('show', function() { frappe.dashboard.show(); }); - } class Dashboard { From ea2019cecaf9245b94412411a4e24ae5e942374a Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 20:51:50 +0530 Subject: [PATCH 035/103] refactor(dashboard): Make Dashboard Chart Form View pretty --- .../dashboard_chart/dashboard_chart.json | 256 +++++++++++++++--- 1 file changed, 222 insertions(+), 34 deletions(-) diff --git a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json index 14c719f9d7..fa606abb88 100644 --- a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json @@ -45,6 +45,37 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -77,6 +108,38 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "chart_details_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Chart Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -110,39 +173,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "filters_json", - "fieldtype": "Code", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Filters JSON", - "length": 0, - "no_copy": 0, - "options": "JSON", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -176,6 +206,37 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_6", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -208,6 +269,69 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "filter_details_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Filter Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_9", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -272,6 +396,70 @@ "set_only_once": 0, "translatable": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_11", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "filters_json", + "fieldtype": "Code", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Filters JSON", + "length": 0, + "no_copy": 0, + "options": "JSON", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 } ], "has_web_view": 0, @@ -284,7 +472,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-01-16 17:05:48.904556", + "modified": "2019-01-16 20:10:54.811477", "modified_by": "Administrator", "module": "Desk", "name": "Dashboard Chart", From 2b86047535ceba6b1107938a7845320f4734ae86 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 20:53:23 +0530 Subject: [PATCH 036/103] fix(dashboard): Show currently set values in Dialog --- frappe/core/page/dashboard/dashboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 71f5b0361a..4f9c172bf7 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -62,8 +62,8 @@ class DashboardChart { show() { this.prepare_chart_object(); this.prepare_container(); - this.fetch().then((data) => { + this.update_last_synced(); this.data = data; this.render(); }); @@ -114,8 +114,8 @@ class DashboardChart { action: "force-refresh", handler: () => { this.fetch(true).then(data => { + this.update_chart_object(); this.data = data; - this.chart_doc.last_synced_on = new Date(); this.render(); }) } @@ -152,7 +152,6 @@ class DashboardChart { } render() { - this.update_last_synced(); const chart_type_map = { "Line": "line", "Bar": "bar", @@ -180,6 +179,7 @@ class DashboardChart { frappe.db.get_doc("Dashboard Chart", this.chart_doc.name).then(doc => { this.chart_doc = doc; this.prepare_chart_object(); + this.update_last_synced(); }); } From 4c436b97f9e6cad6b3fce315c8891d67c9bf869e Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 20:53:58 +0530 Subject: [PATCH 037/103] feat(dashboard): Show Save Filters button after change in filters --- frappe/core/page/dashboard/dashboard.js | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 4f9c172bf7..66d1b0ecf3 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -91,22 +91,29 @@ class DashboardChart { const d = new frappe.ui.Dialog({ title: __('Set Filters'), fields: this.filter_fields, - primary_action: () => { - const values = d.get_values(); - if (!Object.entries(this.filters).map(e => values[e[0]] === e[1]).every(Boolean)) { - frappe.db.set_value("Dashboard Chart", this.chart_doc.name, "filters_json", JSON.stringify(values)).then(() => { - this.fetch().then(data => { - this.data = data; - this.render(); - }) - }); - } - d.hide(); - }, - primary_action_label: __('Save Filters'); - }) + }); d.set_values(this.filters); d.show(); + + const set_filters = () => { + const values = d.get_values(); + if (!Object.entries(this.filters).map(e => values[e[0]] === e[1]).every(Boolean)) { + frappe.db.set_value("Dashboard Chart", this.chart_doc.name, "filters_json", JSON.stringify(values)).then(() => { + this.fetch().then(data => { + this.update_chart_object(); + this.data = data; + this.render(); + }) + }); + } + d.hide(); + } + + this.filter_fields.map(field => field.onchange = e => { + if(e) { + d.set_primary_action(__('Save Filters'), set_filters); + } + }); } }, { From f805a2f4bbbcd8d4ffa4ae712d356dc64c5f1baf Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 16 Jan 2019 21:52:10 +0530 Subject: [PATCH 038/103] style: Linting fixes --- frappe/core/page/dashboard/dashboard.js | 15 +++++++-------- frappe/desk/doctype/dashboard/dashboard.js | 2 +- frappe/desk/doctype/dashboard/dashboard.py | 1 - frappe/desk/doctype/dashboard/test_dashboard.py | 1 - .../doctype/dashboard_chart/dashboard_chart.py | 1 - .../dashboard_chart/test_dashboard_chart.py | 1 - 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/frappe/core/page/dashboard/dashboard.js b/frappe/core/page/dashboard/dashboard.js index 66d1b0ecf3..655bbe7444 100644 --- a/frappe/core/page/dashboard/dashboard.js +++ b/frappe/core/page/dashboard/dashboard.js @@ -9,7 +9,7 @@ frappe.pages['dashboard'].on_page_load = function(wrapper) { $(wrapper).bind('show', function() { frappe.dashboard.show(); }); -} +}; class Dashboard { constructor(wrapper) { @@ -45,7 +45,7 @@ class Dashboard { let dashboard_chart = new DashboardChart(chart_doc, chart_container); dashboard_chart.show(); }); - }) + }); } get_dashboard_doc() { @@ -103,11 +103,11 @@ class DashboardChart { this.update_chart_object(); this.data = data; this.render(); - }) + }); }); } d.hide(); - } + }; this.filter_fields.map(field => field.onchange = e => { if(e) { @@ -124,10 +124,10 @@ class DashboardChart { this.update_chart_object(); this.data = data; this.render(); - }) + }); } } - ] + ]; this.chart_actions = $(`