Skip to Content
Menu
This question has been flagged
3 Replies
7494 Rodiniai

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

Portretas
Atmesti
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

Portretas
Atmesti
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

Portretas
Atmesti
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>

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
birž. 20
4946
1
spal. 19
4098
1
kov. 15
13136
8
saus. 18
42911
2
vas. 16
8416