From 5f61ed8985b3de882e8959f7f2089c933c81b6ed Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Tue, 13 Dec 2016 09:06:50 +0100 Subject: [PATCH] registry is useless in the second branch --- attachment_s3/models/ir_attachment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attachment_s3/models/ir_attachment.py b/attachment_s3/models/ir_attachment.py index 0f9d8ec..91d4dc6 100644 --- a/attachment_s3/models/ir_attachment.py +++ b/attachment_s3/models/ir_attachment.py @@ -240,10 +240,10 @@ class IrAttachment(models.Model): Using a new Odoo Environment thus a new PG transaction. """ with api.Environment.manage(): - registry = openerp.modules.registry.RegistryManager.get( - self.env.cr.dbname - ) if new_cr: + registry = openerp.modules.registry.RegistryManager.get( + self.env.cr.dbname + ) with closing(registry.cursor()) as cr: try: yield self.env(cr=cr)