[FIX] ir_model: Don't prefetch unnecessary fields
Do not prefetch unnecessary fields during the uninstallation of modules. Previous to this commit, prefetching of unnecessary fields would cause server crashes on some modules that add a field on ir_model_fields. i.e. website_form
This commit is contained in:
committed by
Christophe Simonis
parent
dad095de30
commit
c5df78f38b
@@ -1318,7 +1318,9 @@ class IrModelData(models.Model):
|
||||
if model == 'ir.model.fields':
|
||||
# Don't remove the LOG_ACCESS_COLUMNS unless _log_access
|
||||
# has been turned off on the model.
|
||||
field = self.env[model].browse(res_id)
|
||||
field = self.env[model].browse(res_id).with_context(
|
||||
prefetch_fields=False,
|
||||
)
|
||||
if not field.exists():
|
||||
_logger.info('Deleting orphan external_ids %s', external_ids)
|
||||
external_ids.unlink()
|
||||
|
||||
Reference in New Issue
Block a user