base_attachment_storage: _register_hook do nothing if it is disabled

This commit is contained in:
Denis Leemann
2023-08-22 17:29:54 +02:00
parent 0d0ca60710
commit 17a924f862
@@ -79,7 +79,7 @@ class IrAttachment(models.Model):
# migration here. # migration here.
# Typical example is images of ir.ui.menu which are updated in # Typical example is images of ir.ui.menu which are updated in
# ir.attachment at every upgrade of the addons # ir.attachment at every upgrade of the addons
if update_module: if update_module and not self.is_storage_disabled(location):
self.env["ir.attachment"].sudo()._force_storage_to_object_storage() self.env["ir.attachment"].sudo()._force_storage_to_object_storage()
@property @property