Skip to content

[19.0][MIG] database_cleanup: Migration to 19.0 - #3453

Merged
OCA-git-bot merged 81 commits into
OCA:19.0from
bizzappdev:19.0-mig-database_cleanup-BAD
Dec 12, 2025
Merged

[19.0][MIG] database_cleanup: Migration to 19.0#3453
OCA-git-bot merged 81 commits into
OCA:19.0from
bizzappdev:19.0-mig-database_cleanup-BAD

Conversation

@bizzappdev

Copy link
Copy Markdown
Contributor

No description provided.

Stefan Rijnhart and others added 30 commits October 27, 2025 12:56
avoid ''NoneType' object has no attribute 'exists'' error when purging models
fix my change guewen.baconnier@camptocamp.com-20140203103254-v1mzu2uib047xb9h, wrong lines replaced...
    raw SQL query (but never read afterwards). Workaround for
    lp:1277899

[FIX] Preserve dangling workflow table which is in use

[RFR] Group models per table when detecting columns to purge
      to prevent problems with models sharing the same table

[ADD] Allow purging of dangling data entries

[FIX] Data purging now working

[IMP] Docstrings

[FIX] Label
[FIX] Catch attempt to unlink field from nonexisting model

[RFR] Flake8
[CHG] database_cleanup: move description to README.rst
[IMP] order wizard lines by name

[IMP] deal with modules whose models can't be loaded

[IMP] double quotes for docstring

[FIX] use exists query instead of huge in list

[IMP] hide unnecessary buttons in wizard II

[IMP] readability

[FIX] cope with purging nonexisting models
[ADD] test purging modules

[ADD] test purging tables
[FIX] database_cleanup reloads the registry

which has weird side effects during testing. Take care
database_cleanup's tests don't mess up the following tests
* [FIX] database_cleanup: Isolate build
* Isolate `database_cleanup` into its own build in Travis file to fix OCA#689

* [FIX] database_cleanup: Remove KeyError assertion
* Remove KeyError assertion in tests due to PR in comment being merged
* [ADD] allow creating missing indexes

* [FIX] tests; installation

* [ADD] allow purging properties

* [ADD] missing file

* [ADD] test purging properties

* [ADD] missing parent_id for menu entry

* [FIX] don't delete too many and wrong properties
Using new base model inheritance.
[FIX] don't try to uninstall uninstalled modules

[DEL] weird code

[FIX] actually cleanup where we can
Update version number
Use correct import
Update .pot to match new syntax
Adapt icon to fontawesome
Add models description
Rename field external id to new syntax <model>__<field>
To match the new database_cleanup.pot
Following odoo/odoo@54238c88e85d6e a Many2many may have no relation
This avoids having a None record in the list (which is problematic with the
NOT IN clause)
https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_NOT_IN
Currently translated at 100.0% (75 of 75 strings)

Translation: server-tools-18.0/server-tools-18.0-database_cleanup
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_cleanup/it/
@nicomacr

Copy link
Copy Markdown
Contributor

Hi @bizzappdev,
I've started the migration on this PR
I need this module to be installable and this one is not able to install yet.

@bizzappdev

Copy link
Copy Markdown
Contributor Author

We are working on the migration. And almost everything is migrated.
QA guys are testing. Once it is ready within 1 or 2 days, we will commit the migrated version.
@nicomacr

@bizzappdev
bizzappdev marked this pull request as ready for review December 1, 2025 14:37
@bizzappdev

Copy link
Copy Markdown
Contributor Author

@nicomacr modules is migrated and ready for the review.

@nicomacr nicomacr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@twalter-c2c twalter-c2c left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. I am about to test the module functionally. I noticed that you did some refactoring - you moved code blocks for each model to a dedicated file, thank you for that. However, I would really appreciate it if you could keep the refactoring in a separate commit to ease reviewing the migration changes.

yield env


# Use post_install to get all models loaded more info: odoo/odoo#13458

This comment was marked as outdated.



class TestIdentifierAdapter(TransactionCase):
class TestIdentifierAdapter(BaseCommon):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to use the BaseCommon here? Maybe you can make use of disabling tracking: cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) as advised here instead? I believe that disabled tracking is recommended for all tests.

@twalter-c2c

Copy link
Copy Markdown
Contributor

It would be great if you could rebase on top of this PR #3273 since it got merged.

StefanRijnhart and others added 5 commits December 9, 2025 10:41
Currently translated at 100.0% (75 of 75 strings)

Translation: server-tools-18.0/server-tools-18.0-database_cleanup
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_cleanup/de/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-18.0/server-tools-18.0-database_cleanup
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_cleanup/
@bizzappdev
bizzappdev marked this pull request as draft December 9, 2025 05:35
@bizzappdev
bizzappdev force-pushed the 19.0-mig-database_cleanup-BAD branch from 73135f2 to 9a5810d Compare December 9, 2025 05:52

@twalter-c2c twalter-c2c left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates. It looks good now.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@bizzappdev
bizzappdev marked this pull request as ready for review December 11, 2025 07:21
@simahawk

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-3453-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit f2284c5 into OCA:19.0 Dec 12, 2025
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at cb60ff7. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.