Group_id in viewsΒΆ

groups_id in views (mostly in views that inherits other views) allows to specify for which group make those inheritance.

For example, if you need to add a button that will be available for managers only, make the following:

<record id="fleet_vehicle_log_services_form_inherit_bos" model="ir.ui.view">
<field name="name"></field>
<field name="model"></field>
<field name="inherit_id" ref="fleet_vehicle_log_services_form_inherit_buttons"/>
<field name="groups_id" eval="[(4, ref('fleet_booking.group_branch_officer'), 0)]"/>
<field name="arch" type="xml">
        <xpath expr="//button[@name='confirm']" position="attributes">
            <attribute name='attrs'>{'invisible': [('cost_subtype_in_branch', '=', False)]}</attribute>

If groups_id is omitted, then the update is applied for all users.