Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
7497 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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>

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iun. 20
4946
1
oct. 19
4098
1
mar. 15
13136
8
ian. 18
42913
2
feb. 16
8416