[ADD] document_page_access_group_user_role: New module

TT48787
This commit is contained in:
Víctor Martínez
2024-05-31 12:29:33 +02:00
committed by Anusha
parent a014c5a848
commit acf7f9f618
15 changed files with 707 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="document_page_access_group_view_wiki_form" model="ir.ui.view">
<field name="name">document.page.form</field>
<field name="model">document.page</field>
<field
name="inherit_id"
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">
<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>
</field>
</record>
</odoo>