Customized Desk Icons

Hello, i would like to create a desk icon named sales that contain sales order, invoice and payment. is it possible or we cant do a thing like this?

Hi @Perla,

in order to create a desk icon with several underlying functions, you may create a custom app by running

$ bench new-app myapp
$ bench install-app myapp

If you want sour app to be named “Sales”, use Sales instead of myapp. Then in your app, edit the ./config/myapp.py file to create you app’s menu, which can then contain Sales Orders, Invoices and Payments, something like

from __future__ import unicode_literals
from frappe import _

def get_data():
    return[
        {
            "label": _("Sales"),
            "icon": "fa fa-wrench",
            "items": [
                   {
                       "type": "doctype",
                       "name": "Sales Order",
                       "label": "Sales Order",
                       "description": _("Sales Order")
                   },
                   {
                       "type": "doctype",
                       "name": "Sales Invoice",
                       "label": "Sales Invoice",
                       "description": _("Sales Invoice")
                   },
                   {
                       "type": "doctype",
                       "name": "Payment Entry",
                       "label": "Payment Entry",
                       "description": _("Payment Entry")
                   }
            ]
        }
    ]

After you create this, make sure to run

$ bench migrate
$ bench restart

Hope this helps :wink:

4 Likes

hi @lasalesi,
i tried to follow ur steps but when i wrote the second command ($ bench install-app myapp), it gave me an error. The app with this name couldnt be found.

open your apps folder

see if you can find the folder with that name you used in bench new-app command

so now i created the new app, and i edited the config file to create the app menu. i get an error when i run bench migrate.
AttributeError: ‘NoneType’ object has no attribute ‘options’

and also i didnt found the ./config/myapp.py file. i only found desktop.py, is this where i should modify the code to add the items?