Se rendre au contenu
Menu
Cette question a été signalée

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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse

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
Ignorer

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>

Publications associées Réponses Vues Activité
1
mars 23
2963
1
mai 23
1819
2
mars 23
1749
1
nov. 22
2406
0
mai 24
6437