Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2299 Переглядів

I inherited product.template
and i changed the string of total_price field:
total_price=fields.Float(string="All sales price")
i want to change the position of this field to become after list_price field :

<record model="ir\.ui\.view\"\ id=\"product_product_template_view_inherit\"\>


\ \ \ \ \ \ \ \ \ \ \ \ \<field\ name=\"name\"\>product.product.template.view.inherit</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='list_price']" position="after">


                    <field name="total_price" position="move">


                    </field>


                </xpath>


            </field>


        </record>

but it doesn't appear correctly:

Аватар
Відмінити
Найкраща відповідь

Hi 

Please try like this 


<xpath expr="//div[@name='pricing']" position="after">
<field name="total_price"/>
</xpath>

Hope this helps

Regards


Аватар
Відмінити
Автор

Thank you very much

Автор Найкраща відповідь

This is the code of xml:

<record model="ir\.ui\.view\"\ id=\"product_product_template_view_inherit\"\>
\ \ \ \ \<field\ name=\"name\"\>product.product.template.view.inherit</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='list_price']" position="after">
<div>
<label for="total_price" string="All Sales Price"/>
<field name="total_price" position="move" />
</div>


</xpath>



I used label but it doesn't appear correctly

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
трав. 23
2439
2
бер. 23
1977
3
бер. 21
7564
3
квіт. 24
4464
1
січ. 16
8814