[IMP] document_page_access_group_user_role: Users compatibility

TT48786
This commit is contained in:
Víctor Martínez
2024-07-24 08:55:20 +02:00
committed by Anusha
parent 68766adea3
commit c12c8c4bef
8 changed files with 68 additions and 42 deletions

View File

@@ -8,24 +8,21 @@
ref="document_page_access_group.document_page_access_group_view_wiki_form"
/>
<field name="arch" type="xml">
<page name="security" position="after">
<page name="roles" string="Roles" groups="base.group_erp_manager">
<field name="role_ids">
<group name="users" position="before">
<group
name="roles"
string="Roles"
attrs="{'invisible': [('groups_id','!=',[])]}"
groups="base.group_erp_manager"
>
<field name="role_ids" nolabel="1" colspan="2">
<tree>
<field name="name" />
<field name="comment" />
</tree>
</field>
</page>
<!-- It is necessary to add the field without groups to be able to apply the readonly after. !-->
<field name="role_ids" invisible="1" groups="!base.group_erp_manager" />
</page>
<!-- Set groups as readonly if there is a defined roles to avoid UX confusion. !-->
<field name="groups_id" position="attributes">
<attribute
name="attrs"
>{'readonly': [('role_ids', '!=', [])]}</attribute>
</field>
</group>
</group>
</field>
</record>
</odoo>