From d5e446b0af49950ce4fe59587c6ed343bf7a239a Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Tue, 22 Aug 2023 14:57:55 +0200 Subject: [PATCH] base_attachment_storage: _register_hook do nothing if it is disabled --- base_attachment_object_storage/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_attachment_object_storage/models/ir_attachment.py b/base_attachment_object_storage/models/ir_attachment.py index e8b17f5..b730a3d 100644 --- a/base_attachment_object_storage/models/ir_attachment.py +++ b/base_attachment_object_storage/models/ir_attachment.py @@ -59,7 +59,7 @@ class IrAttachment(models.Model): super()._register_hook() location = self.env.context.get("storage_location") or self._storage() # ignore if we are not using an object storage - if location not in self._get_stores(): + if self.is_storage_disabled(location) or location not in self._get_stores(): return curframe = inspect.currentframe() calframe = inspect.getouterframes(curframe, 2)