Daily updates from Odoo
Saturday, February 15, 2025
2 changes · master
Enhancements to existing features
This update renames and separates user access group relationships so Odoo can distinguish between groups assigned directly and groups inherited automatically. This makes permissions behavior clearer and more reliable across accounting and related enterprise features, with limited direct impact for everyday users.
Original PR description
see: https://github.com/odoo/odoo/pull/179354 The `groups_id` from `res.groups` fields have been removed and replaced by `group_ids` and `all_group_ids`. The `users` from `res.groups` fields have…
see: https://github.com/odoo/odoo/pull/179354
The `groups_id` from `res.groups` fields have been removed and replaced by `group_ids` and `all_group_ids`.
The `users` from `res.groups` fields have been removed and replaced by `user_ids` and `all_user_ids`.
Models:
```
<res.groups>:
implied_ids = Many2many <res.groups> Users of this group are also implicitely part of these inherited groups
all_implied_ids = Many2many <res.groups> Transitive and recursive closure
implied_by_ids = Many2many <res.groups> Automatically added from
all_implied_by_ids = Many2many <res.groups> Reversed transitive and recursive closure
user_ids = Many2many <res.users> Users with this group specifically
all_user_ids = Many2many <res.users> Users and implied users
<res.users>:
group_ids = Many2many <res.groups> Group added directly to this user
all_group_ids = Many2many <res.groups> Groups and implied groups
```
Concept:
```
The groups involved are to be interpreted as sets.
Thus we can define groups that we will call for example N, Z... such as mathematical sets.
┌──────────────────────────────────────────┐
│ C ┌──────────────────────────┐ │
│ │ R ┌───────────────────┐ │ ┌──────┐ | "C"
│ │ │ Q ┌────────────┐ │ │ │ I | | "I" implied "C"
│ │ │ │ Z ┌─────┐ │ │ │ │ | | "R" implied "C"
│ │ │ │ │ N │ │ │ │ │ │ │ "Q" implied "R"
│ │ │ │ └─────┘ │ │ │ │ │ │ "P" implied "R"
│ │ │ └────────────┘ │ │ │ │ │ "Z" implied "Q"
│ │ └───────────────────┘ │ │ │ │ "N" implied "Z"
│ │ ┌───────────────┐ │ │ │ │
│ │ │ P │ │ │ │ │
│ │ └───────────────┘ │ └──────┘ │
│ └──────────────────────────┘ │
└──────────────────────────────────────────┘
For example:
* A manager group will imply a user group: all managers are users (like Z imply C);
* A group "computer developer employee" will imply that he is an employee group, a user
group, that he has access to the timesheet user group.... "computer developer employee"
is therefore a set of users in the intersection of these groups. These users will
therefore have all the rights of these groups in addition to their own access rights.
```
XML data example:
```xml
<record model="res.groups" id="group_system">
<field name="name">Settings</field>
<field name="implied_ids" eval="[Command.link(ref('group_erp_manager')), Command.link(ref('group_sanitize_override'))]"/>
<field name="user_ids" eval="[Command.link(ref('base.user_root')), Command.link(ref('base.user_admin'))]"/>
</record>
```
```xml
<record model="res.groups" id="group_no_one">
<field name="name">Technical Features</field>
<field name="implied_by_ids" eval="[Command.link(ref('group_user')), Command.link(ref('group_system'))]"/>
</record>
or
<record model="res.groups" id="group_no_one">
<field name="name">Technical Features</field>
</record>
<record id="group_user">
<field name="implied_ids" eval="[Command.link(ref('group_no_one'))]"/>
</record>
<record id="group_system">
<field name="implied_ids" eval="[Command.link(ref('group_no_one'))]"/>
</record>
```
PY example:
```py
group_helpdesk = self.env.ref('helpdesk.group_helpdesk_user')
group_export = self.env.ref('base.group_allow_export')
group_portal = self.env.ref('base.group_portal')
# we want all users having helpdesk and portal (directly or by implication).
user_portal_helpdesck = self.env['res.users'].search([('all_group_ids', 'in', group_helpdesk.id), ('all_group_ids', 'in', group_portal.id)])
# For these users we want to add access to export.
user_portal_helpdesck.group_ids += group_export
# we want all users having export
user_export = group_export.all_user_ids
# we want all users having specifically export (not by imply)
user_has_export = group_export.user_ids
```Document folders can once again be reordered with drag and drop in Company and My Drive, making organization easier for users. Folder and document names can now be translated again, and the Documents page/detail panel has been stabilized to avoid loading and update issues.
Original PR description
This PR will: - fix an async issue in the DocumentsSearchPanel - fix a field update issue in the DocumentsDetailPanel - make the document/folder name translatable. - add folder drag and drop sorting in the search panel, for 'Company' and 'My Drive' task-4512349