0
2 答案
0
最佳答案
Hi,
I Think you should create a new computed field and use it in the invisible attrs.
The computed field should look like :
hide_validate = field.Boolean(compute='_compute_can_see')
The compute method :
def _compute_can_see(self):
for rec in self
rec.hide_validate = not(self.env.user.has_group(the xmlid of your group))
And finally your view, first your need to add the computed field to the view
attrs="{'invisible': [
'|',
,'&', ('x', '=', True),('hide_validate', '=', True),
'&',
('show_validate', '=', False),('hide_validate', '=', True)
]}"