Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4324 Widoki

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.


Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 15
4609
1
wrz 24
41
2
wrz 22
2597
0
kwi 25
2517
2
gru 24
21177