Skip to Content
Menu
This question has been flagged
3 Replies
7364 Views

Hi there. I want to inherit this view: account.view_account_payment_invoice_form
here is the xml code:


<?xml version="1.0"?>

<data>

            <xpath expr="//header" position="replace"/>

            <xpath expr="//div[@name='button_box']" position="replace"/>

            <xpath expr="//sheet" position="after">

                <footer>

                    <field name="state" invisible="1"/>

                    <button string="Validate" name="post" type="object" class="btn-primary"/>

                    <button string="Cancel" class="btn-secondary" special="cancel"/>

                </footer>

            </xpath>

      </data>


And I need to select one of those <xpath/> element. What I mean: I want to select an xpath with another xpath. I tried to use /*[@expr], //xpath[1], /xpath, etc and get error. ¿Can you help me please?


Thank you in advance

And sorry for my english, I'm a spanish speaker

Avatar
Discard
Best Answer

Hi,

You can't inherit a view by this way /*[@expr], //xpath[1], /xpath 

Please try like this


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

            <field name="name">account.payment.invoice.form.inherit</field>

            <field name="model">account.payment</field>

            <field name="inherit_id" ref="account.view_account_payment_invoice_form"/>

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

               Add your expath expression and position here

                <xpath expr="" position=''>

                        Your code

                </xpath>

            </field>

</record>


Thanks

Muhammed Ali M - iWesabe

Avatar
Discard
Best Answer

the view account.view_account_payment_invoice_form  is inherit from

view_account_payment_form so you can inherit from it and add your new feature in xpath

Avatar
Discard
Best Answer

you can do this way.

inherit view and put xpath as it is just need to change position as per requirement.

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

            <field name = "name"> account.payment.invoice.form </field>

            <field name = "model"> account.payment </field>

            <field name = "inherit_id" ref = "account.view_account_payment_invoice_form" />

            <field name = "mode"> primary </field>

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

                <xpath expr = "// sheet" position = 'inside'>

                    <footer>

                    add your code here///

                    </footer>

                </xpath>

            </field>

        </record>

Avatar
Discard
Related Posts Replies Views Activity
2
Jun 20
4842
1
Oct 19
4020
1
Mar 15
13064
8
Jan 18
42702
2
Feb 16
8357