diff --git a/database_cleanup/README.rst b/database_cleanup/README.rst index 2cf3865369b..51642ff57ee 100644 --- a/database_cleanup/README.rst +++ b/database_cleanup/README.rst @@ -17,13 +17,13 @@ Database cleanup :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github - :target: https://github.com/OCA/server-tools/tree/17.0/database_cleanup + :target: https://github.com/OCA/server-tools/tree/18.0/database_cleanup :alt: OCA/server-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-database_cleanup + :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_cleanup :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -65,7 +65,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -100,6 +100,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-tools `_ project on GitHub. +This module is part of the `OCA/server-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/database_cleanup/__manifest__.py b/database_cleanup/__manifest__.py index f93701daba8..ea192de6b21 100644 --- a/database_cleanup/__manifest__.py +++ b/database_cleanup/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Database cleanup", - "version": "17.0.1.2.1", + "version": "18.0.1.0.0", "author": "Therp BV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/server-tools", "depends": ["base"], diff --git a/database_cleanup/models/purge_wizard.py b/database_cleanup/models/purge_wizard.py index 456ee524a94..e14c2d16fe4 100644 --- a/database_cleanup/models/purge_wizard.py +++ b/database_cleanup/models/purge_wizard.py @@ -72,7 +72,7 @@ def select_lines(self): return { "type": "ir.actions.act_window", "name": _("Select lines to purge"), - "views": [(False, "tree"), (False, "form")], + "views": [(False, "list"), (False, "form")], "res_model": self._fields["purge_line_ids"].comodel_name, "domain": [("wizard_id", "in", self.ids)], } diff --git a/database_cleanup/readme/CREDIT.md b/database_cleanup/readme/CREDIT.md new file mode 100644 index 00000000000..83b3ec91f7d --- /dev/null +++ b/database_cleanup/readme/CREDIT.md @@ -0,0 +1 @@ +The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp. diff --git a/database_cleanup/static/description/index.html b/database_cleanup/static/description/index.html index d1edeebc3f9..44172501be3 100644 --- a/database_cleanup/static/description/index.html +++ b/database_cleanup/static/description/index.html @@ -369,7 +369,7 @@

Database cleanup

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:0cfcda2589a9f11270616e22be3e3560c3360bb96421bba926a9dfd30735398d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

Clean your Odoo database from remnants of modules, models, columns and tables left by uninstalled modules (prior to 7.0) or a homebrew database upgrade to a new major version of Odoo.

@@ -407,7 +407,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -439,7 +439,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/server-tools project on GitHub.

+

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/database_cleanup/tests/common.py b/database_cleanup/tests/common.py index 2223ed4d903..6ab78a32482 100644 --- a/database_cleanup/tests/common.py +++ b/database_cleanup/tests/common.py @@ -15,7 +15,7 @@ def environment(): """Return an environment with a new cursor for the current database; the cursor is committed and closed after the context block. """ - registry = odoo.registry(common.get_db_name()) + registry = odoo.modules.registry.Registry(common.get_db_name()) with registry.cursor() as cr: yield odoo.api.Environment(cr, ADMIN_USER_ID, {}) diff --git a/database_cleanup/tests/test_purge_fields.py b/database_cleanup/tests/test_purge_fields.py index 774c990d92e..0ba75df240e 100644 --- a/database_cleanup/tests/test_purge_fields.py +++ b/database_cleanup/tests/test_purge_fields.py @@ -54,3 +54,13 @@ def test_empty_field(self): ] ) ) + + @classmethod + def tearDownClass(self): + super().tearDownClass() + with environment() as env: + model = env["ir.model"].search( + [("name", "=", "Database cleanup test field-model")] + ) + if model: + model.unlink() diff --git a/database_cleanup/tests/test_purge_modules.py b/database_cleanup/tests/test_purge_modules.py index 46a659ffbc4..eb8dc0e847a 100644 --- a/database_cleanup/tests/test_purge_modules.py +++ b/database_cleanup/tests/test_purge_modules.py @@ -27,3 +27,14 @@ def test_remove_to_upgrade_module(self): lambda x: not x.purged ).mapped("name") self.assertTrue("database_cleanup_test" in module_names) + + @classmethod + def tearDownClass(self): + super().tearDownClass() + with environment() as env: + module = env["ir.module.module"].search( + [("name", "=", "database_cleanup_test")] + ) + if module: + module.state = "uninstalled" + module.unlink() diff --git a/database_cleanup/tests/test_purge_properties.py b/database_cleanup/tests/test_purge_properties.py index 2377ad5c8f0..3c881f9ff42 100644 --- a/database_cleanup/tests/test_purge_properties.py +++ b/database_cleanup/tests/test_purge_properties.py @@ -44,3 +44,13 @@ def test_property_no_value(self): wizard = env["cleanup.purge.wizard.property"].create({}) wizard.purge_all() self.assertFalse(self.property.exists()) + + @classmethod + def tearDownClass(self): + super().tearDownClass() + with environment() as env: + record = env["ir.property"].search( + [("value_text", "=", "My default partner name")] + ) + if record: + record.unlink() diff --git a/database_cleanup/views/purge_wizard.xml b/database_cleanup/views/purge_wizard.xml index ad977f1c911..22c09e8d076 100644 --- a/database_cleanup/views/purge_wizard.xml +++ b/database_cleanup/views/purge_wizard.xml @@ -39,7 +39,7 @@ cleanup.purge.line - +