跳至内容
菜单
此问题已终结
3 回复
4017 查看
<xpath expr="//sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_uom_qty']" position="after">
<
field name="product_uom" attrs="{'column_invisible': [('parent.state', 'not in', ['draft', 'sent'])]}"/>
</
xpath>

other schools operate and this school is not, who can tell me why
形象
丢弃
最佳答案

Hello,

First, make sure you have enabled Units of Measure from Sales > Configuration.

and put the following code,

<record id="view_sale_order_form_inherit_" model="ir.ui.view">

             <field name="name">sale.order.form.inherit</field>

             <field name="model">sale.order</field>

             <field name="inherit_id" ref="sale.view_order_form" />

             <field name="arch" type="xml">

                <xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="attributes">

                    <attribute name="attrs">{'readonly': [('state', 'in', ('sale','done', 'cancel'))], 'column_invisible': [('parent.state', 'not in', ['draft', 'sent'])]}</attribute>

                </xpath>

             </field>

        </record>

Thanks


形象
丢弃
编写者 最佳答案
Bouabaker Abdallah 

I tried a lot of cases and including your case, it doesn't work
形象
丢弃
最佳答案
try this 
    <field name="product_uom" attrs="{'invisible': [('parent.state', '!=', ['draft', 'sent'])]}"/>
形象
丢弃
相关帖文 回复 查看 活动
0
8月 25
52
0
2月 25
765
2
10月 24
3645
1
8月 24
1175
2
6月 24
2218