Skip to Content
Menu
This question has been flagged
1 Reply
5193 Views

how to inherit pivot view from base module

Avatar
Discard
Best Answer

Hi RajaKumari,

Pivot view is nothing but a view basically so you would inherit like you would inherit any view.

Try inheriting them as given below.

Base view:

<record id="view_project_task_pivot" model="ir.ui.view">
   <field name="name">project.task.pivot</field>
   <field name="model">project.task</field>
   <field name="arch" type="xml">
       <pivot string="Project Tasks">
           <field name="project_id" type="row"/>
           <field name="stage_id" type="col"/>
       </pivot>
   </field>
</record>

Inherited view:

<record id="view_project_task_pivot_custom" model="ir.ui.view">
   <field name="name">project.task.pivot.inherit</field>
   <field name="model">project.task</field>
   <field name="inherit_id" ref="view_project_task_pivot"/>
   <field name="arch" type="xml">
       <pivot string="Custom Project Tasks">
           <!-- Your Custom Code Goes Here -->
       </pivot>
   </field>
</record>

If that worked for you then don't forget to accept this as an answer, as it would help others who are stuck on the same question.

Avatar
Discard

Hi I'm trying something similar.

I've added a field to product with studio : x_studio_categorie_libelle

I want to add it in the pivot view in Sales / Analyse.

I tried :

<record model="ir.ui.view" id="view_sale_order_pivot_ah">

<field name="name">sale.order.pivot.inherit</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_sale_order_pivot"/>

<field name="arch" type="xml">

<pivot string="Sales Orders">

<field name="x_studio_categorie_libelle" type="row"/>

</pivot>

</field>

</record>

Unsuccessfull....

An idea ?