Try ERPNext Buy Support Partners Foundation Foundation Members

Custom module links doesn't show in the desktop after v12 upgrade from v11.xx

I have a custom module that was running perfectly on version 11.x. When I upgrade to v12, the links to my module and doctypes are no longer shown in Desktop.

I have the ‘desktop.py’ file in the ‘config’ folder of my custom module and following is the content.

from __future__ import unicode_literals
from frappe import _

def get_data():
	return [
		{
			"module_name": "Vehicle Sales",
			"color": "blue",
			"icon": "octicon octicon-file-directory",
			"type": "module",
			"label": _("Vehicle Sales")
		}
	]

Since the module is not shown, I edited the ‘desktop.py’ file to have following code. However, it is still not shown in the desktop.

from __future__ import unicode_literals
from frappe import _

def get_data():
	return [
		{
			"label": _("Vehicle Sales"),
			"icon": "fa fa-star",
			"items": [
				{
					"type": "doctype",
					"name": "Vehicle Make",
					"onboard": 1,
					"dependencies": [],
					"description": _("Vehicle Sales Module"),
				},
			]
		}
	]

It looks like ‘Set Desktop Icons’ menu is not there anymore under “Menu”. Instead, I can see “Show/Hide Cards” in the desktop but my module is not shown in that pop-up too.

Could someone please help me fixing this issue?

1 Like

It is highly appreciated if someone could help me resolving this.

Thanks!

v12 handles module descriptors a bit differently: Add module Engineering Management (module visibility issue)

Thank you so much! It worked!

I just followed the ‘desktop.py’ and ‘module_name.py’ of ERPNext and it worked.

how did u do ?

In addition to the ‘desktop.py’ file, you also have to create another file with the same name as your module ‘module_name.py’ and define a get_data() function which returns the menu items you want to see.

Here’s a sample content for this file.

from __future__ import unicode_literals
from frappe import _

def get_data():
    return [
        {
            "label": _("Meetings"),
            "icon": "octicon octicon-briefcase",
            "items": [
                {
                    "type": "doctype",
                    "name": "Meeting",
                    "label": _("Meeting"),
                },
            ]
        }
    ]