- def add_section(data, label, icon, items):
- """Adds a section to the module data."""
- if not items: return
- data.append({
- "label": label,
- "icon": icon,
- "items": items
- })
-
-
- def add_custom_doctypes(data, doctype_info):
- """Adds Custom DocTypes to modules setup via `config/desktop.py`."""
- add_section(data, _("Documents"), "fa fa-star",
- [d for d in doctype_info if (d.custom and d.document_type in ("Document", "Transaction"))])
-
- 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()