Skip to content

Commit c012c31

Browse files
committed
fixup! Merge pull request #1 from gurneyalex/15.0-database_cleanup
1 parent fb5e7df commit c012c31

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

database_cleanup/models/purge_tables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def purge(self):
7272
)
7373

7474
self.logger.info("Dropping table %s", line.name)
75-
self.env.cr.execute("DROP TABLE %s CASCADE", (IdentifierAdapter(line.name),))
75+
self.env.cr.execute(
76+
"DROP TABLE %s CASCADE", (IdentifierAdapter(line.name),)
77+
)
7678
line.write({"purged": True})
7779
return True
7880

database_cleanup/tests/common.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from contextlib import contextmanager
44

55
import odoo
6-
from odoo.modules.registry import Registry
7-
from odoo.tests.common import tagged, TransactionCase
6+
from odoo.tests import common
7+
from odoo.tests.common import TransactionCase, tagged
88

99

1010
@contextmanager
@@ -13,13 +13,12 @@ def new_rollbacked_env():
1313
uid = odoo.SUPERUSER_ID
1414
cr = registry.cursor()
1515
try:
16-
yield api.Environment(cr, uid, {})
16+
yield odoo.api.Environment(cr, uid, {})
1717
finally:
1818
cr.rollback() # we shouldn't have to commit anything
1919
cr.close()
2020

2121

22-
2322
# Use post_install to get all models loaded more info: odoo/odoo#13458
2423
@tagged("post_install", "-at_install")
2524
class Common(TransactionCase):

0 commit comments

Comments
 (0)