Skip to Content
Menú
This question has been flagged
1 Respondre
2986 Vistes

i want to add a tab (page) after Deliveries & Invoices tab and add fields into my new tab

<record model="ir.ui.view" id="purchase_order_form"> 
<field name="name">purchase.order.form</field> 
<field name="model">purchase.order</field> 
<field name="inherit_id" ref="purchase.purchase_order_form"/> 
<field name="arch" type="xml">

<xpath expr="//page[@name='Deliveries & Invoices']" position="after">  
<page string='Terms & Conditions'> 
</page> 
</xpath> 
</field> 
</record>

i tried above code and update custom module it says 

Element '<xpath expr="//sheet/notebook/page[@name='Deliveries & Invoices']">' cannot be located in parent view


Avatar
Descartar
Best Answer

There does not seem to be any tab called "Deliveries & Invoices" in the standard Purchase Order form. 

Enable Developer mode, open the form, click on the Developer Tools button  (bug) on the top right, select "Edit View: Form" and look through the underlying xml to find out the correct name of the tab. 

If you do not find the tab in the main xml (Architecture), go through the views in the "Inherited Views" tab to see if there is another view that is extending the functionality of the form and adding the tab to the main form.

Avatar
Descartar
Autor

<page string="Deliveries &amp; Invoices">

In xml (Architecture) above code is written and i copy same string

Autor

i thin this path xpath expr="//sheet/notebook/page[@name='Deliveries & Invoices']"> is incorrect