Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
3760 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer

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>

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 23
2971
1
mei 23
1827
2
mrt. 23
1752
1
nov. 22
2428
0
mei 24
6448