How to override inherited modules

Is it possible to override a module that already has an inherit view within the main xml code.

Main in xml:

      <record model="ir.ui.view" id="view_party_form">
            <field name="model">party.party</field>
           <field name="inherit" ref="party.party_view_form"/>
            <field name="name">party_form</field>
        </record>

Attempted code to override module:

       <record model="ir.ui.view" id="view_not_party_form">
            <field name="model">party.party</field>
            <field name="inherit" ref="party.party_view_form"/>
            <field name="name">not_party_form</field>
        </record>

Also, how do I override a xpath tag? Should it be /form/xpath…?

Yes you can, just override it like you would override any other view. But you’ll have to be aware of the order in which the modules are loaded (from the root of the graph of the modules dependencies and when on the same level by lexicographic order).

You don’t override an XPATH. But you can create an XPATH that takes into account previous XPATH application.

PS: Try to format correctly your code, it makes helping you easier.

1 Like

Alright thank you! And apologies for the poor format of the code, will do so in the future.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.