-4

这是我的源代码,当我从选择框中选择!= 银行值时,我需要知道隐藏bank_id字段?我试过了

attrs="{'invisible': [('special_deduction_type', '!=', 'bank')]}"

也适用于所有字段。但是许多字段显示在布局之外。请参考图片

![<page string="Special Deductions">
<field name='special_deduction_ids' nolabel='1'>
<tree string='List' editable='bottom'>
<field name='deduction_id' invisible="1" />
<field name='special_deduction_type' />
<field name='bank_id'
attrs="{'invisible': \[('special_deduction_type', '=', 'bank')\]}" />
<field name='union_id'
attrs="{'invisible': \[('special_deduction_type', '=', 'union')\]}" />
<field name='insurance_id'
attrs="{'invisible': \[('special_deduction_type', '=', 'insurance')\]}" />
<field name='loan_id'
attrs="{'invisible': \[('special_deduction_type', '=', 'loan')\]}" />
</tree>
</field>]

在此处输入图像描述

4

1 回答 1

0
<page string="Special Deductions">
<field name='special_deduction_ids' nolabel='1'>
<tree string='List' editable='bottom'>
<field name='deduction_id' invisible="1" />
<field name='special_deduction_type' />
<field name='bank_id'
attrs="{'invisible': [('special_deduction_type','in',('loan','union','insurance'))]}"/>
<field name='union_id'
attrs="{'invisible': [('special_deduction_type','in',('bank','loan','insurance'))]}"/>
<field name='insurance_id'
attrs="{'invisible': [('special_deduction_type','in',('loan','union','bank'))]}"/>
<field name='loan_id'
attrs="{'invisible': [('special_deduction_type','in',('bank','union','insurance'))]}"/>

</tree>
</field>
<br />
<br />
</page>
于 2013-04-09T10:31:11.067 回答