To display a new module on desk you need two steps:
- Create
get_data
function inmodule_name.config.desktop.py
that return where you want frappe to display you’re icon on the Desk.
Say you want to add you’re module to the modules section you would add the following:
return [
{
"module_name": "Events",
"category": "Modules",
"color": "blue",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Events")
}
]
Notice category
key, if you want to add your module to another section, Administration
for example, you would change "category": "Administration"
and that’s it.
Now If you reload Desk, nothing will change!
frappe needs another file for this to work, you need to create another get_data
function in module_name.config.module_name.py
that tells frappe what links or pages this icon will show, for example:
def get_data():
"""
Add evetns module to desk home screen.
"""
return [
{
"label": _("Events"),
"icon": "octicon octicon-briefcase",
"items": [
{
"type": "doctype",
"name": "Custom Event",
"label": _("Custom Event"),
"description": _("Custom Events Module Description."),
},
]
}
]
This adds a link to DocType Custom Event
in the Events
module icon on Desk.
Hope this helps.