diff --git a/upgrade_analysis/models/ir_module_module.py b/upgrade_analysis/models/ir_module_module.py index 9456af708..a9a569517 100644 --- a/upgrade_analysis/models/ir_module_module.py +++ b/upgrade_analysis/models/ir_module_module.py @@ -19,17 +19,11 @@ class UpgradeAttribute(models.Model): def _compute_is_oca_module(self): for module in self: - if "/OCA/" in module.website: - module.is_oca_module = True - else: - module.is_oca_module = False + module.is_oca_module = "/OCA/" in module.website def _compute_is_odoo_module(self): for module in self: module_path = get_module_path(module.name) absolute_repo_path = os.path.split(module_path)[0] x, relative_repo_path = os.path.split(absolute_repo_path) - if relative_repo_path == "addons": - module.is_odoo_module = True - else: - module.is_odoo_module = False + module.is_odoo_module = relative_repo_path == "addons" diff --git a/upgrade_analysis/models/upgrade_attribute.py b/upgrade_analysis/models/upgrade_attribute.py index ce6ef46e3..15c934466 100644 --- a/upgrade_analysis/models/upgrade_attribute.py +++ b/upgrade_analysis/models/upgrade_attribute.py @@ -15,6 +15,7 @@ class UpgradeAttribute(models.Model): record_id = fields.Many2one( comodel_name="upgrade.record", + index=True, ondelete="CASCADE", readonly=True, ) diff --git a/upgrade_analysis/models/upgrade_comparison_config.py b/upgrade_analysis/models/upgrade_comparison_config.py index 90553ccf7..95317bf7e 100644 --- a/upgrade_analysis/models/upgrade_comparison_config.py +++ b/upgrade_analysis/models/upgrade_comparison_config.py @@ -67,9 +67,9 @@ class UpgradeComparisonConfig(models.Model): "params": { "type": "info", "message": _( - "You are correctly connected to the server {server}" - " (version {version}) with the user {user_name}" - ).format( + "You are correctly connected to the server %(server)s" + " (version %(version)s) with the user %(user_name)s" + ) % dict( server=self.server, version=self.version, user_name=user_info["name"], diff --git a/upgrade_analysis/tests/test_module.py b/upgrade_analysis/tests/test_module.py index 85a66d9b7..fbb54e505 100644 --- a/upgrade_analysis/tests/test_module.py +++ b/upgrade_analysis/tests/test_module.py @@ -29,8 +29,8 @@ class TestUpgradeAnalysis(common.TransactionCase): ) wizard.select_other_modules() - self.assertTrue( - self.product_module.id not in wizard.module_ids.ids, + self.assertFalse( + self.product_module.id in wizard.module_ids.ids, "Select Other module should not select 'product' module", )