在xml中对one2many 字段屏蔽 添加项目

在xml中对one2many 字段(mrp_workorder_variation_line_ids) 设置 只有在草稿状态下才能编辑

<field name="mrp_workorder_variation_line_ids" nolabel="1" attrs="{'readonly':[('state', '!=', 'draft')]}">
    <tree string="Input Product" editable="bottom">
<field name="product_id"
on_change="on_change_product_uom(product_id)"/>
<field name="product_uom"/>
<field name="product_qty"/>
</tree>
<form string="Input Product" version="7.0">
<field name="product_id"/>
<field name="product_uom"/>
<field name="product_qty"/>
</form>
</field>
posted @ 2017-06-02 17:03  553490191  阅读(231)  评论(0编辑  收藏  举报