Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Created May 9, 2022 06:24
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/7244bd5cd8adb6f00d8e9ec09ebaa502 to your computer and use it in GitHub Desktop.
Save sehrishnaz/7244bd5cd8adb6f00d8e9ec09ebaa502 to your computer and use it in GitHub Desktop.
How to inherit project and task form, tree and search view in Odoo
<record id="inherited_view_project_project_filter" model="ir.ui.view">
<field name="name">inherited.project.project.select</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_project_filter"/>
<field name="arch" type="xml">
<!--Below example shows how to visible invisible fields in search view -->
<xpath expr="//search/field[@name='user_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/field[@name='analytic_account_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/field[@name='tag_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!--Below example shows how to hide extra filters in search view -->
<xpath expr="//filter[@name='my_projects']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='followed_by_me']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='own_projects']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='inactive']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- Below example shows how to hide extra group by in search view -->
<xpath expr="//group/filter[@name='Manager']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//group/filter[@name='status']" position="attributes">
<attribute name="invisible">1</attribute>
</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