Skip to Content
Menu
This question has been flagged

I'm trying to change position and string of field in the inherited view  the code:

<xpath expr="//field[@name='list_price']" position="after">
<label for="total_price" string="All" />
<field name="total_price" position="move" />
</xpath>

but it appears as in the following screen
can i use css to make it show correctly

Avatar
Discard
Best Answer

Hello

in general wml view inhertitance, you have to check if the line you wan to "xpath" is a field or a fiel into a div label.

for a simple field you can xpath with the //field[@name=']

for a field in label it's more complcated , you have to find the

of this section to avoid putting extra information inside.

may be you have to find the nearest and ajust position to after before or replace

Hope this help

Annabelle

Avatar
Discard
Best Answer

Hi,

You Don't need to use css,Just change the field name from list_price  to next field that is  taxes_id and change position to “before”.

Here is the Updated XML of the code this will fix Your style


<?xml version="1.0" encoding="utf-8"?>


<odoo>


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


        <field name="name">res.partner.form</field>


        <field name="model">product.template</field>


        <field name="inherit_id" ref="product.product_template_only_form_view"/>


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


            <xpath expr="//field[@name='taxes_id']" position="before">


                        <field name="total_price" string="Total Price" />


            </xpath>


        </field>


    </record>




Hope it helps





Avatar
Discard
Best Answer

Hi @Asmaa

Hope you are doing well,

For you to change the position your field, you will need to place it after 

Find the code in below comment.


and add a higher priority to the inherited view.


Hope this would be helpful.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

Here is the code .

<xpath expr="//div[@name='pricing']" position="after">
<label for="total_price" string="All"/>
<div class="totalprice">
<field name="total_price" position="move"/>
</div>
</xpath>

Related Posts Replies Views Activity
1
Mar 23
2930
1
May 23
1789
2
Mar 23
1714
1
Nov 22
2361
0
May 24
6388