fixup! [MIG] database_cleanup: Migration to 14.0
parent
7d8967fe32
commit
96e244055f
|
@ -77,7 +77,7 @@ class CleanupPurgeWizardModule(models.TransientModel):
|
||||||
{
|
{
|
||||||
"name": module.name,
|
"name": module.name,
|
||||||
}
|
}
|
||||||
).purge()
|
)
|
||||||
continue
|
continue
|
||||||
res.append((0, 0, {"name": module.name}))
|
res.append((0, 0, {"name": module.name}))
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
|
|
||||||
from odoo.modules.registry import Registry
|
from odoo.modules.registry import Registry
|
||||||
from odoo.tests import TransactionCase
|
from odoo.tests import TransactionCase
|
||||||
from odoo.tests.common import tagged
|
|
||||||
|
|
||||||
|
|
||||||
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
|
||||||
@tagged("post_install", "-at_install")
|
|
||||||
class Common(TransactionCase):
|
class Common(TransactionCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(Common, self).setUp()
|
super(Common, self).setUp()
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCreateIndexesLine(Common):
|
class TestCreateIndexesLine(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCreateIndexesLine, self).setUp()
|
super(TestCreateIndexesLine, self).setUp()
|
||||||
|
|
|
@ -2,11 +2,14 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
from psycopg2 import ProgrammingError
|
from psycopg2 import ProgrammingError
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
from odoo.tools import mute_logger
|
from odoo.tools import mute_logger
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineColumn(Common):
|
class TestCleanupPurgeLineColumn(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineColumn, self).setUp()
|
super(TestCleanupPurgeLineColumn, self).setUp()
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineData(Common):
|
class TestCleanupPurgeLineData(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineData, self).setUp()
|
super(TestCleanupPurgeLineData, self).setUp()
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineMenu(Common):
|
class TestCleanupPurgeLineMenu(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineMenu, self).setUp()
|
super(TestCleanupPurgeLineMenu, self).setUp()
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineColumn(Common):
|
class TestCleanupPurgeLineColumn(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineColumn, self).setUp()
|
super(TestCleanupPurgeLineColumn, self).setUp()
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
import threading
|
|
||||||
|
|
||||||
from odoo.tools import config
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineModule(Common):
|
class TestCleanupPurgeLineModule(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineModule, self).setUp()
|
super(TestCleanupPurgeLineModule, self).setUp()
|
||||||
|
@ -20,16 +21,7 @@ class TestCleanupPurgeLineModule(Common):
|
||||||
|
|
||||||
def test_remove_to_upgrade_module(self):
|
def test_remove_to_upgrade_module(self):
|
||||||
wizard = self.env["cleanup.purge.wizard.module"].create({})
|
wizard = self.env["cleanup.purge.wizard.module"].create({})
|
||||||
config.options["test_enable"] = False # Maybe useless now ?!
|
module_names = wizard.purge_line_ids.filtered(lambda x: not x.purged).mapped(
|
||||||
self.patch(threading.currentThread(), "testing", False)
|
"name"
|
||||||
wizard.purge_all()
|
|
||||||
config.options["test_enable"] = True # Maybe useless now ?!
|
|
||||||
self.patch(threading.currentThread(), "testing", True)
|
|
||||||
# must be removed by the wizard
|
|
||||||
self.assertFalse(
|
|
||||||
self.env["ir.module.module"].search(
|
|
||||||
[
|
|
||||||
("name", "=", "database_cleanup_test"),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
self.assertTrue("database_cleanup_test" in module_names)
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Copyright 2021 Camptocamp SA
|
# Copyright 2021 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineProperty(Common):
|
class TestCleanupPurgeLineProperty(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineProperty, self).setUp()
|
super(TestCleanupPurgeLineProperty, self).setUp()
|
||||||
|
|
|
@ -2,11 +2,14 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
from psycopg2 import ProgrammingError
|
from psycopg2 import ProgrammingError
|
||||||
|
|
||||||
|
from odoo.tests.common import tagged
|
||||||
from odoo.tools import mute_logger
|
from odoo.tools import mute_logger
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
# Use post_install to get all models loaded more info: odoo/odoo#13458
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
class TestCleanupPurgeLineTable(Common):
|
class TestCleanupPurgeLineTable(Common):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestCleanupPurgeLineTable, self).setUp()
|
super(TestCleanupPurgeLineTable, self).setUp()
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="model_id" ref="database_cleanup.model_cleanup_purge_wizard_menu" />
|
<field name="model_id" ref="database_cleanup.model_cleanup_purge_wizard_menu" />
|
||||||
<field name="code">
|
<field name="code">
|
||||||
action = env.get('cleanup.purge.wizard').get_wizard_action()
|
action = env.get('cleanup.purge.wizard.menu').get_wizard_action()
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue