I am developing an ERPNext app. I need desk icon, but the standard octicon icons won’t work for me. According to the documentation, I should be able to add my own svg file - and I have. The documentation, however, appears to be out of date (e.g. I’m not using a desktop/config.py
file, it is config/desktop.py
, and the document format is slightly different), so I’m can’t be sure of anything the document says.
Here’s my config/desktop.py
:
# -*- coding: utf-8 -*-
from __future__ import unicode_literals from frappe import _
def get_data():
return [
{
"module_name": "dividers",
"color": "grey",
"icon": "assets/dividers/images/dividers-module.svg",
"type": "module",
"label": _("Dividers"),
}
]
Here’s the code it generates on the page (indented for readability):
<div data-v-42551af3="">
<i
data-v-42551af3=""
class="assets/dividers/images/dividers-module.svg"
style="color: rgb(141, 153, 166); font-size: 18px; margin-right: 6px;"
></i>
</div>
As you can see, ERPNext dumps my icon path into the class as if it was an icon rather than an svg image.
I have confirmed that the icon is accessible at the indicated path. What do I need to change to get ERPNext to display my icon?