如何在openerp中选择选项时隐藏/显示字段

时间:2015-02-16 06:21:56

标签: openerp-7 odoo

我有一个选择字段和文本字段

'work': fields.selection([('tax', 'Tax Audit'), ('statutary',
'Statutary'), ('certificate', 'Certificate'), ('projection',
'Projections'), ('acount', 'Accounting'), ('others', 'Others'),
('roc', 'ROC Reg'), ('vat', 'VAT')], 'Nature Of Work'),
'details':fields.text('Details'),

<field name="work" select="0"/>
<field name="details" select="0"/>

详细信息字段必须仅在选择'roc'和'vat'时可见 我怎么能得到这个请帮帮我

1 个答案:

答案 0 :(得分:3)

请尝试以下操作:

<field name="details" attrs="{'invisible':[('work','not in',['roc','vat'])]}"/>