mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
fix: remove deprecated useless function (#446)
This commit is contained in:
co-authored by
GitHub
parent
b9cbf71b55
commit
59059f4344
@@ -260,22 +260,21 @@ class IrAttachment(models.Model):
|
|||||||
|
|
||||||
Using a new Odoo Environment thus a new PG transaction.
|
Using a new Odoo Environment thus a new PG transaction.
|
||||||
"""
|
"""
|
||||||
with api.Environment.manage():
|
if new_cr:
|
||||||
if new_cr:
|
registry = odoo.modules.registry.Registry.new(self.env.cr.dbname)
|
||||||
registry = odoo.modules.registry.Registry.new(self.env.cr.dbname)
|
with closing(registry.cursor()) as cr:
|
||||||
with closing(registry.cursor()) as cr:
|
try:
|
||||||
try:
|
yield self.env(cr=cr)
|
||||||
yield self.env(cr=cr)
|
except Exception:
|
||||||
except Exception:
|
cr.rollback()
|
||||||
cr.rollback()
|
raise
|
||||||
raise
|
else:
|
||||||
else:
|
# disable pylint error because this is a valid commit,
|
||||||
# disable pylint error because this is a valid commit,
|
# we are in a new env
|
||||||
# we are in a new env
|
cr.commit() # pylint: disable=invalid-commit
|
||||||
cr.commit() # pylint: disable=invalid-commit
|
else:
|
||||||
else:
|
# make a copy
|
||||||
# make a copy
|
yield self.env()
|
||||||
yield self.env()
|
|
||||||
|
|
||||||
def _move_attachment_to_store(self):
|
def _move_attachment_to_store(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
|||||||
Reference in New Issue
Block a user