Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
4 Besvarelser
6766 Visninger

I've installed Odoo 13.0 Community Edition and I already changed the module icons from Settings -> Technical -> Menu Items but that did not change how the icons look in general settings menu. How can i change those icons? I have not changed any XML codes for the settings because I actually do not know how to or where to find the files...

Avatar
Kassér
Bedste svar

The menu does not have to do with the icon inside the general settings menus.

These setting menus are created from JS and is looking at the icon.png file inside "module_name/static/description/icon.png" inside the module.

_getAppIconUrl is the method of JS to create the icon URL. You will have to override this method and add the path of your icon. You can add the condition to change the icon of a specific module(s).

Try the following code in your custom module:

Ex:

odoo.define('custom_base.settings', function (require) {
"use strict";

var BaseSettingRenderer = require('base.settings').Renderer;

BaseSettingRenderer.include({

_getAppIconUrl: function (module) {
if (module == 'website') {
return "/my_website_module/static/description/icon.png";
}
else {
return this._super.apply(this, arguments);
}
}
});
});

I hope this will solve your problem.


Avatar
Kassér
Bedste svar

Keep an icon.png image under the description folder and make sure to use the data-key attribute.

for example:

<div class="app_settings_block"
data-string="Debrand"
string="Debrand"
data-key="odoo-debrand-11"
>
Avatar
Kassér
Forfatter Bedste svar

Since I still cannot comment as I do not have enough Karma, I'm writing this as an answer but I'm asking where do I insert this piece of code Hilar AK added.

Avatar
Kassér

please update your question with the XML code that you added for general settings.