跳至内容
菜单
此问题已终结
1 回复
4323 查看

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.


形象
丢弃
最佳答案

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


形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
4609
1
9月 24
41
2
9月 22
2597
0
4月 25
2517
2
12月 24
21177