diff --git a/frappe/config/__init__.py b/frappe/config/__init__.py index 2d4ff0245c..6bd61419c5 100644 --- a/frappe/config/__init__.py +++ b/frappe/config/__init__.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from frappe import _ import frappe -from frappe.desk.moduleview import get_data, get_onboard_items +from frappe.desk.moduleview import get_data from six import iteritems def get_modules_from_all_apps_for_user(user=None): @@ -62,8 +62,6 @@ def get_modules_from_app(app): to_add = False if to_add: - m["shortcuts"] = get_onboard_items(app, frappe.scrub(m["module_name"])) - m["app"] = app active_modules_list.append(m) return active_modules_list @@ -76,6 +74,7 @@ def get_all_empty_tables_by_module(): JOIN tabDocType as d ON i.table_name = CONCAT('tab', d.name) WHERE table_rows = 0; + """) empty_tables_by_module = {} diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 0b06b138a5..6d429f3248 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1601,39 +1601,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "{\"Modules\": {}, \"Administration\": {}}", - "fieldname": "home_settings", - "fieldtype": "Code", - "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": "Home Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "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, @@ -2336,7 +2303,7 @@ "issingle": 0, "istable": 0, "max_attachments": 5, - "modified": "2019-03-01 10:02:01.433443", + "modified": "2019-01-30 13:56:10.732154", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/desk/moduleview.py b/frappe/desk/moduleview.py index 5e6ed90d4e..43b5a30e64 100644 --- a/frappe/desk/moduleview.py +++ b/frappe/desk/moduleview.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.boot import get_allowed_pages, get_allowed_reports from frappe.desk.doctype.desktop_icon.desktop_icon import set_hidden, clear_desktop_icons_cache - @frappe.whitelist() def get(module): """Returns data (sections, list of reports, counts) to render module view in desk: @@ -20,13 +19,11 @@ def get(module): return out - @frappe.whitelist() def hide_module(module): set_hidden(module, frappe.session.user, 1) clear_desktop_icons_cache() - def get_data(module, build=True): """Get module data for the module view `desk/#Module/[name]`""" doctype_info = get_doctype_info(module) @@ -83,7 +80,6 @@ def get_data(module, build=True): return data - def build_config_from_file(module): """Build module info from `app/config/desktop.py` files.""" data = [] @@ -97,7 +93,6 @@ def build_config_from_file(module): return filter_by_restrict_to_domain(data) - def filter_by_restrict_to_domain(data): """ filter Pages and DocType depending on the Active Module(s) """ mapper = { @@ -119,7 +114,6 @@ def filter_by_restrict_to_domain(data): return data - def build_standard_config(module, doctype_info): """Build standard module data from DocTypes.""" if not frappe.db.get_value("Module Def", module): @@ -138,7 +132,6 @@ def build_standard_config(module, doctype_info): return data - def add_section(data, label, icon, items): """Adds a section to the module data.""" if not items: return @@ -157,7 +150,6 @@ def add_custom_doctypes(data, doctype_info): add_section(data, _("Setup"), "fa fa-cog", [d for d in doctype_info if (d.custom and d.document_type in ("Setup", "Master", ""))]) - def get_doctype_info(module): """Returns list of non child DocTypes for given module.""" active_domains = frappe.get_active_domains() @@ -177,7 +169,6 @@ def get_doctype_info(module): return doctype_info - def combine_common_sections(data): """Combine sections declared in separate apps.""" sections = [] @@ -191,7 +182,6 @@ def combine_common_sections(data): return sections - def apply_permissions(data): default_country = frappe.db.get_default("country") @@ -225,14 +215,11 @@ def apply_permissions(data): return new_data - def get_config(app, module): """Load module info from `[app].config.[module]`.""" config = frappe.get_module("{app}.config.{module}".format(app=app, module=module)) config = config.get_data() - print(module) - sections = [s for s in config if s.get("condition", True)] for section in sections: @@ -245,7 +232,6 @@ def get_config(app, module): return sections - def add_setup_section(config, app, module, label, icon): """Add common sections to `/desk#Module/Setup`""" try: @@ -255,7 +241,6 @@ def add_setup_section(config, app, module, label, icon): except ImportError: pass - def get_setup_section(app, module, label, icon): """Get the setup section from each module (for global Setup page).""" config = get_config(app, module) @@ -267,46 +252,12 @@ def get_setup_section(app, module, label, icon): "items": section["items"] } - -def get_onboard_items(app, module): - try: - sections = get_config(app, module) - except ImportError: - return [] - - onboard_items = [] - - for section in sections: - for item in section["items"]: - if item.get("onboard", 0) == 1: - onboard_items.append(item) - return onboard_items - - -@frappe.whitelist() -def get_links(app, module): - try: - sections = get_config(app, frappe.scrub(module)) - except ImportError: - return [] - - link_names = [] - - - for section in sections: - for item in section["items"]: - link_names.append(item.get("label")) - print(link_names) - return link_names - - def set_last_modified(data): for section in data: for item in section["items"]: if item["type"] == "doctype": item["last_modified"] = get_last_modified(item["name"]) - def get_last_modified(doctype): def _get(): try: @@ -330,7 +281,6 @@ def get_last_modified(doctype): return last_modified - def get_report_list(module, is_standard="No"): """Returns list on new style reports for modules.""" reports = frappe.get_list("Report", fields=["name", "ref_doctype", "report_type"], filters= diff --git a/frappe/public/js/frappe/views/components/DeskSection.vue b/frappe/public/js/frappe/views/components/DeskSection.vue deleted file mode 100644 index d6748e2476..0000000000 --- a/frappe/public/js/frappe/views/components/DeskSection.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - diff --git a/frappe/public/js/frappe/views/components/Desktop.vue b/frappe/public/js/frappe/views/components/Desktop.vue index 4ed76c02b6..30c09a6cd9 100644 --- a/frappe/public/js/frappe/views/components/Desktop.vue +++ b/frappe/public/js/frappe/views/components/Desktop.vue @@ -4,12 +4,27 @@
@@ -17,12 +32,8 @@