0
在Python中,我有以下领域:的OpenERP如何使按钮点击事件按钮隐形
'permit':fields.selection([('new', 'New'),
('applied', 'Applied'),
('received','Received')], 'Permit', select=True),
def apply_permit(self, cr, uid, ids, context=None):
data = {'value': {'permit':'applied'}}
return data
在XML中,我有以下几点:
<field name="permit" readonly="True"/>
<button name="apply_permit" string="Apply" type="action" class="oe_highlight" attrs="{'invisible':[('permit','=','applied')]}" />
的ATTRS以上代码没有按目前没有工作,但我想要做的是:当点击按钮“允许”字段值将被设置为“应用”,然后隐藏按钮。所有这些都在表单保存之前完成。该按钮位于表单内。