Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
3803 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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





อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

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 ตอบกลับ มุมมอง กิจกรรม
how to inherit form in odoo 16 แก้ไขแล้ว
1
มี.ค. 23
3002
1
พ.ค. 23
1870
2
มี.ค. 23
1772
1
พ.ย. 22
2487
0
พ.ค. 24
6501