1

purchase_line_id我想在树视图中添加一个按钮,并且当它为 NULL时我想让它不可见。

我怎样才能做到这一点?以下是我的观点继承代码。

<record id="view_move_pickingextended_tree" model="ir.ui.view">
            <field name="name">stock.move.tree.extended</field>
            <field name="model">stock.move</field>
            <field name="inherit_id" ref="stock.view_move_picking_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='state']" position="after">
                    <button name="%(uom_conv_trans_level_thura)d" string="Manual Pick"
                            type="action" class="oe_highlight" icon="fa-book"
                            context="{'product_id':product_id}" invisible="context.get('purchase_line_id',False)"/>
            </xpath>
        </field>
    </record>
4

1 回答 1

4

试一试

<button name="%(uom_conv_trans_level_thura)d" string="Manual Pick"
        type="action" class="oe_highlight" icon="fa-book"
        context="{'product_id':product_id}"
        attrs="{'invisible': [('purchase_line_id', '=', False)]}" />
于 2015-08-16T19:00:28.630 回答