• Tek Siong, Hock

Odoo - Action window to view specific Form, Tree, Pivot, etc

This Odoo technical development blog is my way to contribute back to the Odoo Community, for all the selfless and great sharing by the community members.


If you have inherited the Odoo model and would like a different Form, Tree, Pivot, Calendar view for your inherited model, the following code will be useful.

You may also have your own search filter, without inheriting from the parent search view.


Click "Like" at the bottom of this blog, to motivate us to continue sharing more Odoo tips.

 <record id="action_my_job" model="ir.actions.act_window">
<field name="name">Job 1</field>
      <field name="type">ir.actions.act_window</field>
<field name="res_model">my.model</field>
<field name="view_mode">tree,form,calendar</field>
       <field name="view_ids" eval="[(5, 0, 0),
              (0, 0, {'view_mode': 'tree', 'view_id': ref('view_tree_my_job')}),
              (0, 0, {'view_mode': 'form', 'view_id': ref('view_form_my_job')}),
              (0, 0, {'view_mode': 'calendar', 'view_id': ref('view_calendar_my_job')})]"
        />
        <field name="search_view_id" ref="view_search_my_job"/>
       <field name="domain">[('job_category','=','local')]</field>
</record>

28 views

©2019 by Excelroot Technology Sdn Bhd.