From 5e05e8cdefa089fcea86269000fb2c5be0b8652a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Thu, 12 Dec 2024 11:20:50 +0100 Subject: [PATCH 1/3] [FIX] upgrade_analysis: new modules cannot be merged/renamed in same version --- upgrade_analysis/models/upgrade_analysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/upgrade_analysis/models/upgrade_analysis.py b/upgrade_analysis/models/upgrade_analysis.py index 8d0e53aa5d9..18943487ae9 100644 --- a/upgrade_analysis/models/upgrade_analysis.py +++ b/upgrade_analysis/models/upgrade_analysis.py @@ -552,16 +552,18 @@ 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: + 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 = ( From cba1280de877714763688754d3d46ca6301d93d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Thu, 12 Dec 2024 11:24:45 +0100 Subject: [PATCH 2/3] [FIX] upgrade_analysis: exclude OU modules from coverage file --- upgrade_analysis/models/upgrade_analysis.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/upgrade_analysis/models/upgrade_analysis.py b/upgrade_analysis/models/upgrade_analysis.py index 18943487ae9..8083c6cf4ae 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() From e04584d0bb9cb27b15cb3c99ef8edfceb8d0cc55 Mon Sep 17 00:00:00 2001 From: Jean-Charles Drubay Date: Tue, 10 May 2022 22:16:31 +0700 Subject: [PATCH 3/3] [FIX] smart button to open the list of analysis from a config --- upgrade_analysis/README.rst | 15 +++++++++++---- .../models/upgrade_comparison_config.py | 8 +++++++- upgrade_analysis/readme/DESCRIPTION.rst | 11 +++++++++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/upgrade_analysis/README.rst b/upgrade_analysis/README.rst index 6dc740b49c2..33c4c460ec2 100644 --- a/upgrade_analysis/README.rst +++ b/upgrade_analysis/README.rst @@ -2,7 +2,7 @@ Upgrade Analysis ================ -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! @@ -28,9 +28,16 @@ Upgrade Analysis |badge1| |badge2| |badge3| |badge4| |badge5| -This module provides the tool to generate the database analysis files that indicate how the Odoo data model and module data have changed between two versions of Odoo. Database analysis files for the core modules are included in the OpenUpgrade distribution so as a migration script developer you will not usually need to use this tool yourself. If you do need to run your analysis of a custom set of modules, please refer to the documentation here: https://doc.therp.nl/openupgrade/analysis.html +This module provides the tool to generate the database analysis files that indicate +how the Odoo data model and module data have changed between two versions of Odoo. +Database analysis files for the core modules are included in the OpenUpgrade +distribution so as a migration script developer you will not usually need to use +this tool yourself. If you do need to run your analysis of a custom set of modules, +please refer to the documentation here: https://doc.therp.nl/openupgrade/analysis.html -This module is just a tool, a continuation of the old openupgrade_records in OpenUpgrade in previous versions. It's not recommended to have this module in a production database. +This module is just a tool, a continuation of the old openupgrade_records in +OpenUpgrade in previous versions. It's not recommended to have this module in a +production database. **Table of contents** @@ -102,7 +109,7 @@ promote its widespread use. Current `maintainers `__: -|maintainer-StefanRijnhart| |maintainer-legalsylvain| +|maintainer-StefanRijnhart| |maintainer-legalsylvain| This module is part of the `OCA/server-tools `_ project on GitHub. 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/readme/DESCRIPTION.rst b/upgrade_analysis/readme/DESCRIPTION.rst index 1b12e675fe0..d6539b4f1a1 100644 --- a/upgrade_analysis/readme/DESCRIPTION.rst +++ b/upgrade_analysis/readme/DESCRIPTION.rst @@ -1,3 +1,10 @@ -This module provides the tool to generate the database analysis files that indicate how the Odoo data model and module data have changed between two versions of Odoo. Database analysis files for the core modules are included in the OpenUpgrade distribution so as a migration script developer you will not usually need to use this tool yourself. If you do need to run your analysis of a custom set of modules, please refer to the documentation here: https://doc.therp.nl/openupgrade/analysis.html +This module provides the tool to generate the database analysis files that indicate +how the Odoo data model and module data have changed between two versions of Odoo. +Database analysis files for the core modules are included in the OpenUpgrade +distribution so as a migration script developer you will not usually need to use +this tool yourself. If you do need to run your analysis of a custom set of modules, +please refer to the documentation here: https://doc.therp.nl/openupgrade/analysis.html -This module is just a tool, a continuation of the old openupgrade_records in OpenUpgrade in previous versions. It's not recommended to have this module in a production database. +This module is just a tool, a continuation of the old openupgrade_records in +OpenUpgrade in previous versions. It's not recommended to have this module in a +production database.