Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
7702 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 20
5104
1
oct 19
4209
1
mar 15
13330
8
ene 18
43126
2
feb 16
8504