Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Created May 9, 2022 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehrishnaz/6eb66ce94e3cb725a840f84eaf31282f to your computer and use it in GitHub Desktop.
Save sehrishnaz/6eb66ce94e3cb725a840f84eaf31282f to your computer and use it in GitHub Desktop.
How to inherit task tree view in Odoo
<!--Inherit task tree view -->
<record id="inherit_project_task_tree" model="ir.ui.view">
<field name="name">project.task.tree.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_tree2"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="delete">1</attribute>
</xpath>
<!--Below example shows how to visible invisible fields in tree view -->
<xpath expr="//tree/field[@name='priority']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//tree/field[@name='user_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//tree/field[@name='activity_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//tree/field[@name='tag_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!--Below example shows how to add fields in tree view -->
<xpath expr="//tree/field[@name='name']" position="after">
<field name="field_1"/>
<field name="field_2"/>
</xpath>
</field>
</record>
@sehrishnaz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment