diff --git a/README.md b/README.md index c7b5edd3b20..bfbd63b0896 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ addon | version | maintainers | summary [server_action_logging](server_action_logging/) | 17.0.1.0.0 | | Module that provides a logging mechanism for server actions [session_db](session_db/) | 17.0.1.0.0 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB [tracking_manager](tracking_manager/) | 17.0.1.0.7 | [![Kev-Roche](https://github.com/Kev-Roche.png?size=30px)](https://github.com/Kev-Roche) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | This module tracks all fields of a model, including one2many and many2many ones. -[upgrade_analysis](upgrade_analysis/) | 17.0.1.0.1 | [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Performs a difference analysis between modules installed on two different Odoo instances +[upgrade_analysis](upgrade_analysis/) | 17.0.1.0.2 | [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Performs a difference analysis between modules installed on two different Odoo instances Unported addons diff --git a/upgrade_analysis/README.rst b/upgrade_analysis/README.rst index 50a1610588e..6ce9e6facc8 100644 --- a/upgrade_analysis/README.rst +++ b/upgrade_analysis/README.rst @@ -7,7 +7,7 @@ Upgrade Analysis !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:06e4beaded7780203b89871f8ebde11988d0b43336a97eaeec324ca429f3fd80 + !! source digest: sha256:0eab5b561650419e0df6f886a3a0faa50e7534265f0c7ab1ad742767d423fae5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -54,11 +54,11 @@ Usage Known issues / Roadmap ====================== -- Log removed modules in the module that owned them (#468) -- Detect renamed many2many tables (#213) -- Make sure that the ``migration_analysis.txt`` file is always - generated in all cases. (See: - https://github.com/OCA/OpenUpgrade/pull/3209#issuecomment-1157449981) +- Log removed modules in the module that owned them (#468) +- Detect renamed many2many tables (#213) +- Make sure that the ``migration_analysis.txt`` file is always generated + in all cases. (See: + https://github.com/OCA/OpenUpgrade/pull/3209#issuecomment-1157449981) Bug Tracker =========== @@ -83,13 +83,13 @@ Authors Contributors ------------ -- Stefan Rijnhart -- Holger Brunn -- Pedro M. Baeza -- Ferdinand Gassauer -- Florent Xicluna -- Miquel Raïch -- Sylvain LE GAL +- Stefan Rijnhart +- Holger Brunn +- Pedro M. Baeza +- Ferdinand Gassauer +- Florent Xicluna +- Miquel Raïch +- Sylvain LE GAL Maintainers ----------- diff --git a/upgrade_analysis/__manifest__.py b/upgrade_analysis/__manifest__.py index 9a6435dc29b..79881ec6d5b 100644 --- a/upgrade_analysis/__manifest__.py +++ b/upgrade_analysis/__manifest__.py @@ -5,7 +5,7 @@ "name": "Upgrade Analysis", "summary": "Performs a difference analysis between modules" " installed on two different Odoo instances", - "version": "17.0.1.0.1", + "version": "17.0.1.0.2", "category": "Migration", "author": "Therp BV, Opener B.V., GRAP, Odoo Community Association (OCA)", "maintainers": ["StefanRijnhart", "legalsylvain"], diff --git a/upgrade_analysis/compare.py b/upgrade_analysis/compare.py index 74c95d1adfd..900398f2da4 100644 --- a/upgrade_analysis/compare.py +++ b/upgrade_analysis/compare.py @@ -480,7 +480,8 @@ def compare_model_sets(old_records, new_records): text += f" [{column['model_type']}]" reprs[module_map(column["module"])].append(text) reprs["general"].append( - f"obsolete model {model} [module module_map(column['module'])]" + f"obsolete model {model} " + f"[module {module_map(column['module'])}]" ) else: moved_module = "" @@ -492,7 +493,7 @@ def compare_model_sets(old_records, new_records): moved_module, ) if column["model_type"]: - text += " [column['model_type']]" + text += f" [{column['model_type']}]" reprs[module_map(column["module"])].append(text) reprs["general"].append( f"obsolete model {model} (renamed to {model_map(model)}) " @@ -502,11 +503,11 @@ def compare_model_sets(old_records, new_records): if module_map(column["module"]) != new_models[model]: text = f"model {model} (moved to {new_models[model]})" if column["model_type"]: - text += " [column['model_type']]" + text += f" [{column['model_type']}]" reprs[module_map(column["module"])].append(text) text = f"model {model} (moved from {old_models[model]})" if column["model_type"]: - text += " [column['model_type']]" + text += f" [{column['model_type']}]" for column in copy.copy(new_records): model = column["model"] diff --git a/upgrade_analysis/models/upgrade_analysis.py b/upgrade_analysis/models/upgrade_analysis.py index b1e0789a88a..7fcad1b9895 100644 --- a/upgrade_analysis/models/upgrade_analysis.py +++ b/upgrade_analysis/models/upgrade_analysis.py @@ -532,7 +532,16 @@ def generate_module_coverage_file(self, no_changes_modules): module_domain = [ ("state", "=", "installed"), - ("name", "not in", ["upgrade_analysis", "openupgrade_records"]), + ( + "name", + "not in", + [ + "upgrade_analysis", + "openupgrade_records", + "openupgrade_scripts", + "openupgrade_framework", + ], + ), ] connection = self.config_id.get_connection() @@ -552,16 +561,19 @@ def generate_module_coverage_file(self, no_changes_modules): module_descriptions = {} for module in all_modules: status = "" + is_new = False if module in all_local_modules and module in all_remote_modules: module_description = " %s" % module elif module in all_local_modules: module_description = " |new| %s" % module + is_new = True else: module_description = " |del| %s" % module - if module in compare.apriori.merged_modules: + # new modules cannot be merged/renamed in same version + if not is_new and module in compare.apriori.merged_modules: status = "Merged into %s. " % compare.apriori.merged_modules[module] - elif module in compare.apriori.renamed_modules: + elif not is_new and module in compare.apriori.renamed_modules: status = "Renamed to %s. " % compare.apriori.renamed_modules[module] elif module in compare.apriori.renamed_modules.values(): status = ( diff --git a/upgrade_analysis/models/upgrade_comparison_config.py b/upgrade_analysis/models/upgrade_comparison_config.py index 649866379af..9ba4e2b3ac8 100644 --- a/upgrade_analysis/models/upgrade_comparison_config.py +++ b/upgrade_analysis/models/upgrade_comparison_config.py @@ -93,4 +93,10 @@ def new_analysis(self): def action_show_analysis(self): self.ensure_one() - return {} + return { + "type": "ir.actions.act_window", + "name": "Analyses", + "res_model": "upgrade.analysis", + "view_mode": "tree,form", + "domain": [("id", "in", self.analysis_ids.ids)], + } diff --git a/upgrade_analysis/static/description/index.html b/upgrade_analysis/static/description/index.html index 864027e55c4..d47453ebbbe 100644 --- a/upgrade_analysis/static/description/index.html +++ b/upgrade_analysis/static/description/index.html @@ -367,7 +367,7 @@

Upgrade Analysis

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:06e4beaded7780203b89871f8ebde11988d0b43336a97eaeec324ca429f3fd80 +!! source digest: sha256:0eab5b561650419e0df6f886a3a0faa50e7534265f0c7ab1ad742767d423fae5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

This module provides the tool to generate the database analysis files @@ -404,8 +404,8 @@

Known issues / Roadmap

  • Log removed modules in the module that owned them (#468)
  • Detect renamed many2many tables (#213)
  • -
  • Make sure that the migration_analysis.txt file is always -generated in all cases. (See: +
  • Make sure that the migration_analysis.txt file is always generated +in all cases. (See: https://github.com/OCA/OpenUpgrade/pull/3209#issuecomment-1157449981)
diff --git a/upgrade_analysis/tests/test_module.py b/upgrade_analysis/tests/test_module.py index 1fef3325b55..e3e71fbfece 100644 --- a/upgrade_analysis/tests/test_module.py +++ b/upgrade_analysis/tests/test_module.py @@ -8,7 +8,7 @@ class TestUpgradeAnalysis(common.TransactionCase): def setUp(self): super().setUp() self.IrModuleModule = self.env["ir.module.module"] - self.product_module = self.IrModuleModule.search([("name", "=", "product")]) + self.website_module = self.IrModuleModule.search([("name", "=", "website")]) self.sale_module = self.IrModuleModule.search([("name", "=", "sale")]) self.upgrade_analysis = self.IrModuleModule.search( [("name", "=", "upgrade_analysis")] @@ -20,19 +20,19 @@ def test_upgrade_install_wizard(self): wizard.select_odoo_modules() self.assertTrue( - self.product_module.id in wizard.module_ids.ids, + self.website_module.id in wizard.module_ids.ids, "Select Odoo module should select 'product' module", ) - - wizard.select_oca_modules() - self.assertTrue( - self.upgrade_analysis.id in wizard.module_ids.ids, - "Select OCA module should select 'upgrade_analysis' module", - ) + # New patch avoids to reinstall already installed modules, so this will fail + # wizard.select_oca_modules() + # self.assertTrue( + # self.upgrade_analysis.id in wizard.module_ids.ids, + # "Select OCA module should select 'upgrade_analysis' module", + # ) wizard.select_other_modules() self.assertFalse( - self.product_module.id in wizard.module_ids.ids, + self.website_module.id in wizard.module_ids.ids, "Select Other module should not select 'product' module", ) diff --git a/upgrade_analysis/upgrade_log.py b/upgrade_analysis/upgrade_log.py index a0df0dc62d4..687072771b6 100644 --- a/upgrade_analysis/upgrade_log.py +++ b/upgrade_analysis/upgrade_log.py @@ -213,7 +213,7 @@ def log_xml_id(cr, module, xml_id): if "." not in xml_id: xml_id = f"{module}.{xml_id}" cr.execute( - "SELECT model FROM ir_model_data " "WHERE module = %s AND name = %s", + "SELECT model FROM ir_model_data WHERE module = %s AND name = %s", xml_id.split("."), ) record = cr.fetchone() diff --git a/upgrade_analysis/wizards/upgrade_install_wizard.py b/upgrade_analysis/wizards/upgrade_install_wizard.py index 968a28c8be7..7c5f05d37dc 100644 --- a/upgrade_analysis/wizards/upgrade_install_wizard.py +++ b/upgrade_analysis/wizards/upgrade_install_wizard.py @@ -35,7 +35,7 @@ class UpgradeInstallWizard(models.TransientModel): def _module_ids_domain(self, extra_domain=None): domain = [ "&", - ("state", "not in", ["uninstallable", "unknown"]), + ("state", "not in", ["installed", "uninstallable", "unknown"]), ("name", "not in", BLACKLIST_MODULES), ] if extra_domain: