Search code examples
python-3.xodoo-12

add div tag in invoice configuration in odoo 12


can anyone please help me regarding invoice configuration in odoo 12. i am trying to add div tag inside invoice configuration page but got no success.

<record id="res_config_inherit_view_form" model="ir.ui.view">
    <field name="name">res.config.form.inherit</field>
    <field name="model">res.config.settings</field>
    <field name="inherit_id" ref="base.res_config_settings_view_form"/>
    <field name="arch" type="xml">
        <xpath expr="//div[hasclass('app_settings_block')]" position="inside">
            <h2>Notification</h2>
            <div></div>
        </xpath>
    </field>
</record>

i have inherited transient model of res.config.settings in my py file.


Solution

  • i just changed reference from base.res_config_settings_view_form to account.res_config_settings_view_form and in xpath i added data-key which is sat in the div tag of class named app_settings_block in account.res_config_settings_view_form xml, in account.invoice it adds all the divs of invoice configuration.

    <record id="res_config_inherit_view_form" model="ir.ui.view">
            <field name="name">res.config.form.inherit</field>
            <field name="model">res.config.settings</field>
            <field name="inherit_id" ref="account.res_config_settings_view_form"/>
            <field name="arch" type="xml">
    
                <xpath expr="//div[@data-key='account']" position="inside">
                    <h2>Notification</h2>
                    <div class="row mt16 o_settings_container" id="notification">
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="unpaid_notification"/>
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="unpaid_notification" string="Unpaid invoice reminder"/>
                                <div class="text-muted">
                                    Auto send unpaid invoice emails to the partners
                                </div>
                            </div>
                        </div>
                    </div>
                </xpath>
    
            </field>
        </record>