From f1625d66d684dc56b1a6fe2e2863eb8214c6ae25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Duy=20=28=C4=90=E1=BB=97=20Anh=29?= Date: Wed, 8 Jan 2025 15:51:28 +0700 Subject: [PATCH] [IMP] web.assets_common warning removed --- .../migrate_160_170/web_assets_common.yaml | 2 ++ tests/data_result/module_160_170/__manifest__.py | 3 +++ .../data_result/module_160_170/views/template.xml | 5 +++++ tests/data_template/module_160/__manifest__.py | 3 +++ tests/data_template/module_160/views/template.xml | 5 +++++ tests/test_migration.py | 15 +++++++++++++++ 6 files changed, 33 insertions(+) create mode 100644 odoo_module_migrate/migration_scripts/text_warnings/migrate_160_170/web_assets_common.yaml create mode 100644 tests/data_result/module_160_170/views/template.xml create mode 100644 tests/data_template/module_160/views/template.xml diff --git a/odoo_module_migrate/migration_scripts/text_warnings/migrate_160_170/web_assets_common.yaml b/odoo_module_migrate/migration_scripts/text_warnings/migrate_160_170/web_assets_common.yaml new file mode 100644 index 0000000..90f635b --- /dev/null +++ b/odoo_module_migrate/migration_scripts/text_warnings/migrate_160_170/web_assets_common.yaml @@ -0,0 +1,2 @@ +"*": + web.assets_common: "[17] Reference to 'web.assets_common'. This bundle has been removed from odoo, see https://github.com/odoo/odoo/pull/132190" diff --git a/tests/data_result/module_160_170/__manifest__.py b/tests/data_result/module_160_170/__manifest__.py index 03b83e7..e2b94de 100644 --- a/tests/data_result/module_160_170/__manifest__.py +++ b/tests/data_result/module_160_170/__manifest__.py @@ -11,4 +11,7 @@ 'data': [ 'views/res_partner.xml', ], + "assets": { + "web.assets_common", + } } diff --git a/tests/data_result/module_160_170/views/template.xml b/tests/data_result/module_160_170/views/template.xml new file mode 100644 index 0000000..1c1a7ce --- /dev/null +++ b/tests/data_result/module_160_170/views/template.xml @@ -0,0 +1,5 @@ + diff --git a/tests/data_template/module_160/__manifest__.py b/tests/data_template/module_160/__manifest__.py index be85fc2..d4d6c9f 100644 --- a/tests/data_template/module_160/__manifest__.py +++ b/tests/data_template/module_160/__manifest__.py @@ -11,4 +11,7 @@ 'data': [ 'views/res_partner.xml', ], + "assets": { + "web.assets_common", + } } diff --git a/tests/data_template/module_160/views/template.xml b/tests/data_template/module_160/views/template.xml new file mode 100644 index 0000000..1c1a7ce --- /dev/null +++ b/tests/data_template/module_160/views/template.xml @@ -0,0 +1,5 @@ + diff --git a/tests/test_migration.py b/tests/test_migration.py index aaaff77..b55ad04 100644 --- a/tests/test_migration.py +++ b/tests/test_migration.py @@ -143,6 +143,21 @@ def test_migration_160_170(self): "Differences found in the following files\n- %s" % ("\n- ".join(diff_files)), ) + log_content = _read_content(str(self._working_path / "test_log.log")) + required_logs = [ + ( + "WARNING", + "[17].*'web.assets_common'.*This bundle has been removed.*", + ), + ] + for required_log in required_logs: + level, message = required_log + pattern = "{0}.*{1}".format(level, message) + self.assertNotEqual( + len(re.findall(pattern, log_content)), + 0, + "%s not found in the log" % pattern, + ) def test_migration_170_180(self): self._migrate_module("module_170", "module_170_180", "17.0", "18.0")