diff --git a/odoo/models.py b/odoo/models.py index 8d3cfe6eaa8af..cf7fc0b24d966 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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 @@ -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)