Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] Allow super user to set log_access fields. #56

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions odoo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4662,8 +4662,8 @@ def write(self, vals: ValuesType) -> typing.Literal[True]:

bad_names = {'id', 'parent_path'}
if self._log_access:
# the superuser can set log_access fields while loading registry
if not(self.env.uid == SUPERUSER_ID and not self.pool.ready):
# the superuser can set log_access fields
if not(self.env.uid == SUPERUSER_ID):
bad_names.update(LOG_ACCESS_COLUMNS)

# set magic fields
Expand Down Expand Up @@ -5049,8 +5049,8 @@ def _prepare_create_values(self, vals_list):
"""
bad_names = ['id', 'parent_path']
if self._log_access:
# the superuser can set log_access fields while loading registry
if not(self.env.uid == SUPERUSER_ID and not self.pool.ready):
# the superuser can set log_access fields
if not(self.env.uid == SUPERUSER_ID):
bad_names.extend(LOG_ACCESS_COLUMNS)

# also discard precomputed readonly fields (to force their computation)
Expand Down