Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
6767 Widoki

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...

Awatar
Odrzuć
Najlepsza odpowiedź

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.


Awatar
Odrzuć
Najlepsza odpowiedź

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"
>
Awatar
Odrzuć
Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć

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