mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-20 12:22:18 -06:00
[ADD] document_page_access_group_user_role: New module
TT48787
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user