Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
7496 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Jun 20
4946
1
Okt 19
4098
1
Mar 15
13136
8
Jan 18
42911
2
Feb 16
8416