Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4364 Vizualizări

Hi I have a field named 'product_description' I want to display it in the quotation for that I also want that field to be in sale order and invoice as well. 

I have started by inheriting sale.order.line and corresponding view sale.view_order_form

<record model="ir.ui.view" id="view_order_form_inherit1">
<field name="name">view.order.form.inherit1</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="product_description"/>
</xpath>
<xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
</field>
</record>

Field appeared right after Product in sale order form.

Similarly for quotation template

<record model="ir.ui.view" id="sale_order_template_view_inherit">
<field name="name">sale.order.template.view.inherit1</field>
<field name="model">sale.order.template</field>
<field name="inherit_id" ref="sale_management.sale_order_template_view_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook[@name='main_book']//tree//field[@name='name']" position="after">
<field name='product_description'/>
</xpath>
<xpath expr="//notebook[@name='main_book']//tree//field[@name='name']" position="attributes">
<attribute name='invisible'>True</attribute>
</xpath>
</field>

But when I am creating quotation and selecting quotation template that product description is not getting fitted in sale order line.


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,
Maybe it’s because of the wrong xpath. You can try this:

<xpath expr="//tree/field[@name='name']" position="after">
<field name='product_description'/>
</xpath>
<xpath expr="//tree/field[@name='name']" position="attributes">
<attribute name='invisible'>0</attribute>
</xpath>
Regards


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 15
4618
1
sept. 24
41
2
sept. 22
2631
0
apr. 25
2548
2
dec. 24
21238