fix(patch): naming
This commit is contained in:
parent
d2bde40992
commit
352eaf0aa2
2 changed files with 11 additions and 10 deletions
|
|
@ -1,9 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
import frappe
|
||||
import json
|
||||
from frappe.desk.moduleview import get_data, get_onboard_items, config_exists, get_module_link_items_from_list
|
||||
from six import iteritems
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.desk.moduleview import (get_data, get_onboard_items, config_exists, get_module_link_items_from_list)
|
||||
|
||||
def get_modules_from_all_apps_for_user(user=None):
|
||||
if not user:
|
||||
|
|
|
|||
|
|
@ -1,29 +1,30 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import json
|
||||
import frappe
|
||||
from frappe.config import get_modules_from_all_apps_for_user
|
||||
from frappe.desk.moduleview import get_onboard_items
|
||||
|
||||
def execute():
|
||||
"""Set the initial customizations for desk, with modules, indices and links."""
|
||||
frappe.reload_doc("core", "doctype", "user")
|
||||
all_modules = get_modules_from_all_apps_for_user()
|
||||
|
||||
settings = {}
|
||||
|
||||
for idx, m in enumerate(all_modules):
|
||||
links = get_onboard_items(m["app"], frappe.scrub(m["module_name"]))[:5]
|
||||
for module in all_modules:
|
||||
links = get_onboard_items(module["app"], frappe.scrub(module["module_name"]))[:5]
|
||||
module_settings = {
|
||||
"links": ",".join([d["label"] for d in links])
|
||||
}
|
||||
category_dict = settings.get(m.get("category", ""), None)
|
||||
category_dict = settings.get(module.get("category", ""), None)
|
||||
if category_dict:
|
||||
module_settings["index"] = len(category_dict)
|
||||
category_dict[m.get("module_name")] = module_settings
|
||||
category_dict[module.get("module_name")] = module_settings
|
||||
else:
|
||||
module_settings["index"] = 0
|
||||
settings[m.get("category", "")] = {
|
||||
m.get("module_name"): module_settings
|
||||
settings[module.get("category", "")] = {
|
||||
module.get("module_name"): module_settings
|
||||
}
|
||||
|
||||
settings_json_str = json.dumps(settings)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue