registry is useless in the second branch

This commit is contained in:
Guewen Baconnier
2016-12-13 09:06:50 +01:00
parent 53d7cdf3e7
commit 5f61ed8985
+3 -3
View File
@@ -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)