Skip to Content
Menu
You need to be registered to interact with the community.
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
Opusti
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
Opusti
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
Opusti
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
Opusti

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 Odgovori Prikazi Aktivnost
1
mar. 23
2935
1
maj 23
1792
2
mar. 23
1717
1
nov. 22
2368
0
maj 24
6393