0
employee_category_m2o':fields.many2one('employee.transition.category','Category')
是我的字段。如果用户在many2one
字段中选择了“合同人工”,则应该使其他字符“grade
”不可见。根据Many2one字段值(名称而不是ID)在openerp 6.1中隐藏一个字段
employee_category_m2o':fields.many2one('employee.transition.category','Category')
是我的字段。如果用户在many2one
字段中选择了“合同人工”,则应该使其他字符“grade
”不可见。根据Many2one字段值(名称而不是ID)在openerp 6.1中隐藏一个字段
对于这第一个你需要的many2one的选项“劳动合同”的外部ID。
获得外部身份证后,它非常简单。 你只需要提供attrs到xml中的“等级”字段。
<field name="grade" attrs="{'invisible':[('employee_category_m2o','=',%(External id of Contract Labour)d)]}"/>
感谢回答。但是这并不能解决我的问题。我想是这样的 \t \t \t \t \t \t \t \t <属性名= “ATTRS”> {'隐形“:[(”性别”,‘=’,‘女性’)]} \t \t \t - > –
Meg
我只想用在我many2one表中指定的名称的值,而不是ID,因为ID将是不同但不是名字。 – Meg
然后,只有创建选择字段而不是many2one的方法。 –