Hi all,
I am new to Odoo development. I was trying to make a custom setting tab for my module but it is not showing. Here is what I have done. My module is under zk_sandbox folder
Create a res_config_settings.py inherited from res.config.settings
from odoo import models, fields
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
zk_sandbox_is_enabled = fields.Boolean(string='Enable Advanced Feature')
create a res_config_settings_views.xml
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id='res_config_settings_view_form' model='ir.ui.view'>
<field name='name'>res.config.settings.view.form.inherit.zk_sandbox</field>
<field name='model'>res.config.settings</field>
<field name='priority' eval='80'/>
<field name='inherit_id' ref='base.res_config_settings_view_form'/>
<field name='arch' type='xml'>
<xpath expr="//div[hasclass('settings')]" position='inside'>
<div class='app_settings_block' data-string="Library" string="Library" data-key="zk_sandbox" >
<h2>Library</h2>
<div class='row mt16 o_settings_container'>
<div class="col-12 col-lg-6 o_setting_box" title="Show organizational chart on employee form">
<div class="o_setting_left_pane">
<field name="zk_sandbox_is_enabled"/>
</div>
<div class="o_setting_right_pane">
<label for="zk_sandbox_is_enabled"/>
<div class="text-muted">
Is advanced feature enabled?
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="library_config_settings_action" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_id" ref="res_config_settings_view_form"/>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'zk_sandbox'}</field>
</record>
<menuitem name="Settings" id="library_book_setting_menu" parent="library_resources_configuration" action="library_config_settings_action" sequence="0"/>
</odoo>
library_resources_configuration is defined in another view xml file as
<menuitem id="library_resources_configuration" name="Configuration" parent="library_base_menu"/>
Reload the odoo-bin, upgrade the module. But I didn't see the configuration menu in my module also I didn't see the configuration tab for my little module in the general settings. I have not include the group permission in the view. Did I miss anything here? Thanks in advance.