[FIX] base: disable prefetching during module uninstall #2
Create any module that inherit 'res.lang'. Define any new field that is added with that inheritance. Install that module. Then try to uninstall it. Traceback ensues. When trying to write 'state': 'uninstalled' on the module, the prefetching tries to read a column that has been deleted by the _module_data_uninstall. opw 1917369 closes odoo/odoo#30176
This commit is contained in:
@@ -463,7 +463,8 @@ class Module(models.Model):
|
||||
"""
|
||||
modules_to_remove = self.mapped('name')
|
||||
self.env['ir.model.data']._module_data_uninstall(modules_to_remove)
|
||||
self.write({'state': 'uninstalled', 'latest_version': False})
|
||||
# we deactivate prefetching to not try to read a column that has been deleted
|
||||
self.with_context(prefetch_fields=False).write({'state': 'uninstalled', 'latest_version': False})
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user