Skip to content

Commit

Permalink
[16.0][FIX] auditlog: Add/Remove User Group
Browse files Browse the repository at this point in the history
When adding/removing a group in a user (and tracking a user or a partner), odoo sends a 'reified' val 'in_group_{group_id}'. We must convert this value into the real groups_id one.
  • Loading branch information
BT-anieto committed Feb 8, 2024
1 parent a3abec1 commit 5573382
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions auditlog/models/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ def write_full(self, vals, **kwargs):
.with_context(prefetch_fields=False)
.read(fields_list)
}
# invalidate_recordset method must be called with
if self._name == 'res.users':
vals = self._remove_reified_groups(vals)

Check warning on line 392 in auditlog/models/rule.py

View check run for this annotation

Codecov / codecov/patch

auditlog/models/rule.py#L392

Added line #L392 was not covered by tests
# Prevent the cache of modified fields from being poisoned by
# x2many items inaccessible to the current user.
self.invalidate_recordset(vals.keys())
Expand Down

0 comments on commit 5573382

Please sign in to comment.