【发布时间】:2015-08-16 11:26:54
【问题描述】:
我想在树视图中添加一个按钮,并且我想在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>
【问题讨论】:
-
该字段仅在上下文中?