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

Hello I have an issue with inheritance , I try to inherit the view of customer invoice for that I define an action view using the model account.invoice with the external ID :account.invoice_form 
http://i.imgur.com/pAESugJ.png

but when I open my view I find that odoo inherit the view of the supplier invoice with the external ID :account.invoice_supplier_form normally my view should have the same external ID I don't know why odoo inherit the view of the supplier invoice 
http://i.imgur.com/sD2HQjI.png
Avatar
Discard
Best Answer

Hi Hamza,

For Inherit account view, follow below code sample :

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

            <field name="name">inherit.invoice.form.view</field>
            <field name="model">account.invoice</field>
            if inherit customer invoice then inherit_id account.invoice_form
            <field name="inherit_id" ref="account.invoice_form"/>
            if inherit supplier invoice then inherit_id account.invoice_supplier_form
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
            <field name="arch" type="xml">
             <xpath expr="//field[@name='existing_field_name']" position="after">
              <field name="your_field_name"
             </xpath>
            </field>
        </record>


I hope this helps you.

Thanks!

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 24
419
2
Nov 24
745
3
Oct 23
13195
2
Feb 23
1228
1
Dec 22
1371