[IMP] upgrade_analysis: make us of odoorpc/openupgrade master

Includes minor fixes.
pull/2417/head
mreficent 2021-03-23 17:30:49 +01:00 committed by Stefan Rijnhart
parent 480412abc8
commit 9ddb08c5db
5 changed files with 8 additions and 13 deletions

View File

@ -2,7 +2,7 @@ BLACKLIST_MODULES = []
# the hw_* modules are not affected by a migration as they don't # the hw_* modules are not affected by a migration as they don't
# contain any ORM functionality, but they do start up threads that # contain any ORM functionality, but they do start up threads that
# delay the process and spit out annoying log messages continously. # delay the process and spit out annoying log messages continuously.
# We also don't want to analyze tests modules # We also don't want to analyze tests modules
BLACKLIST_MODULES_STARTS_WITH = ["hw_", "test_"] BLACKLIST_MODULES_STARTS_WITH = ["hw_", "test_"]

View File

@ -14,14 +14,14 @@ import copy
try: try:
from odoo.addons.openupgrade_scripts import apriori from odoo.addons.openupgrade_scripts import apriori
except ImportError: except ImportError:
from dataclasses import dataclass, field from dataclasses import dataclass, field as dc_field
@dataclass @dataclass
class NullApriori: class NullApriori:
renamed_modules: dict = field(default_factory=dict) renamed_modules: dict = dc_field(default_factory=dict)
merged_modules: dict = field(default_factory=dict) merged_modules: dict = dc_field(default_factory=dict)
renamed_models: dict = field(default_factory=dict) renamed_models: dict = dc_field(default_factory=dict)
merged_models: dict = field(default_factory=dict) merged_models: dict = dc_field(default_factory=dict)
apriori = NullApriori() apriori = NullApriori()

View File

@ -430,7 +430,7 @@ class UpgradeAnalysis(models.Model):
raise ValidationError( raise ValidationError(
_( _(
"Unexpected root Element: %s in file: %s" "Unexpected root Element: %s in file: %s"
% (tree.getroot(), xml_file) % (root_node.getroot(), xml_file)
) )
) )
for node in root_node: for node in root_node:

View File

@ -54,7 +54,7 @@ class OdooPatch(object):
if hasattr(method, "_original_method"): if hasattr(method, "_original_method"):
setattr(cls.target, method_name, method._original_method) setattr(cls.target, method_name, method._original_method)
else: else:
_logger.warn( _logger.warning(
"_original_method not found on method %s of class %s", "_original_method not found on method %s of class %s",
method_name, method_name,
cls.target, cls.target,

View File

@ -17,10 +17,6 @@ class UpgradeInstallWizard(models.TransientModel):
_name = "upgrade.install.wizard" _name = "upgrade.install.wizard"
_description = "Upgrade Install Wizard" _description = "Upgrade Install Wizard"
name = fields.Char(
default=_description,
help="Workaround for https://github.com/OCA/odoorpc/issues/57",
)
state = fields.Selection( state = fields.Selection(
[("draft", "Draft"), ("done", "Done")], readonly=True, default="draft" [("draft", "Draft"), ("done", "Done")], readonly=True, default="draft"
) )
@ -109,7 +105,6 @@ class UpgradeInstallWizard(models.TransientModel):
"type": "ir.actions.act_window", "type": "ir.actions.act_window",
"res_model": "upgrade.install.wizard", "res_model": "upgrade.install.wizard",
"view_mode": "form", "view_mode": "form",
"view_type": "form",
"res_id": self.id, "res_id": self.id,
"views": [(False, "form")], "views": [(False, "form")],
"target": "new", "target": "new",