Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
10611 Prikazi

Hello everyone,

I have created a new area under "General Settings" (res_config_settings) for Odoo 12.

If I set my module as "application = True", I can see the icon defined for the module shown on the new General Settings Area

My problem is that my module is not an application. It is an addon and in this case, I cannot see the icon shown on this new settings area.

How can I force an icon to be shown on General Settings area?

Thank you all in advance

Best regards

PM

Avatar
Opusti
Best Answer

You have to define some settings in res.config.settings model and in view, for example


<odoo>
    <record id="res_config_settings_view_form" model="ir.ui.view">
        <field name="name">Debranding Configuration</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="website.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('app_settings_block')]" position="after">
                <div class="app_settings_block"
                     data-string="Debrand"
                     string="Debrand"
                     data-key="odoo-debrand-11"
                >
                                ...

.....

Here is an example form my debranding module. You can refer to this module and can find how I did for the debranding settings.

links:   https://github.com/hilarak/odoo_community_addons/blob/12.0/odoo-debrand-11/views/views.xml

Appstore: https://www.odoo.com/apps/modules/12.0/odoo-debrand-11/


Avatar
Opusti
Avtor

Thank you @Hilar,

Your links are very useful. I do use your debranding module also.

I have looked on the code and I did not find any part of it where you refer the "icon" to be shown under new area for general Settings. Unfortunately I am unable to post images here since several weeks.

I will try to explain myself:

- When we access General Settings, we can see on the left side, settings for the several applications installed.

Here we have: General Settings, Invoicing, Sales, Inventory... and so on, depending on the applications installed.

Every specific "settings area" has an icon which is the exact same icon as the application icon (ie. for the invoicing settings area, we can see the icon defined for the invoicing application).

I have created a "new settings area" for my addon, but the icon defined for my addon does not show on this new "settings area" I have created.

For testing purposes, I changed my addon to became an application instead of an addon and the icon shows fine for this new "settings area" I have created. So, if I define my addon as an application, icon shows fine, if I make it an addon, the icon does not show.

How can I make the icon show on this area for an addon (not an application)?

Thank you once again

best regards

PM

Best Answer

Hello Paulo 

For adding icon in general settings you just follow one thing.

<div class="app_settings_block" data-string="Website Addon" string="

Website Addon" data-key="module_name">

In data key add your module name that's it then you able to see icon without setting application= True

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
jul. 20
13386
3
okt. 23
9489
1
sep. 23
3635
1
maj 23
2547
2
apr. 23
3179