I would like to use an existing view in another menu by adding some new fields. When i execute that, it is the same view which is show. it doesn't take my new fields. someone can help ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
1418
Views
Hi,
You need to create a new view which inherit from initial wiew like this:
<record id="recor_id" model="ir.ui.view">
<fieldname="name">yourname</field>
<field name="model">model.name</field>
<field name="inherit_id" ref="moduleName.idParentWiew"/>
<field name="arch" type="xml">
<-- Fields you want add-->
</field>
</record>
Can you please show whatever you tried.
Here is my code :
<record id="lbudget_id" model="ir.ui.view">
<fieldname="name">Ligne budgetaire</field>
<field name="model">budg_lbudget</field>
<field name ="priority" eval ="16"/>
<field name ="arch" type ="xml">
<-- Fields for the first view-->
</field>
</record>
<record id="validerbudget_id" model="ir.ui.view">
<field="name">Valider budget</field>
<field name="model">budg_lbuget</field>
<field name ="priority" eval ="16"/>
<field name ="arch" type ="xml">
<-- Fields for the first view-->
<-- Fields that i want to add in the second view-->
</field>
</record>
<record id="budget_id" model="ir.actions.act_windows" id="act_budget">
<field="name">Budget</field>
<field="res_model">budg_lbudget</field>
<field="view_model">tree,form</field>
</record>
<record id="validebudget_id" model="ir.actions.act_windows" id="act_validebudget">
<field="name">Valider budget</field>
<field="res_model">budg_lbudget</field>
<field="view_model">tree,form</field>
<field="view_id" ref="lbudget_id"/>
</record>
How to display two or more form and tree view for same model. You can define different tree and form view for same model. To achieve this we will create a split action for our object/model.
Reference: https://goo.gl/8ypbbg