Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4342 Prikazi

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.


Avatar
Opusti
Best Answer

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


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
mar. 15
4609
1
sep. 24
41
2
sep. 22
2605
0
apr. 25
2521
2
dec. 24
21182