I need to hide view that I create for users that do not have specific access rights group. I know I can use groups
attribute for every field that I add in my view, so those users would not see it. But it is quite redundant as I need to hide every field in that view. So maybe there is some way that I can just hide whole view? In this example it hides for every field, because group is added for those fields.
<record id="view_partner_additional_view" model="ir.ui.view">
<field name="name">res.partner.patient.form.inherit</field>
<field name="model">res.partner</field>
<field name="priority">2</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<label for="is_company" string="Is a Company?" position="after">
<field name="is_something"
attrs="{'invisible': [('is_company','=',True)]}"
groups="some_grp"/>
<field name="is_something2"
attrs="{'invisible': [('is_company','=',False)]}"
groups="some_grp"/>
</label>
</field>
</record>
Is it possible to somehow wrap whole view and define it that it will be invisible to user that does not have 'some_grp' access rights group? What I mean is that I would need to add groups attribute once, not for every field. I tried wrapping everything with div
and then adding groups
attribute there, but I got error, because you can't wrap it everything like that.