Skip to content

[19.0][MIG] mail_cleanup: Migration to 19.0#3618

Open
dnplkndll wants to merge 16 commits into
OCA:19.0from
ledoent:19.0-mig-mail_cleanup
Open

[19.0][MIG] mail_cleanup: Migration to 19.0#3618
dnplkndll wants to merge 16 commits into
OCA:19.0from
ledoent:19.0-mig-mail_cleanup

Conversation

@dnplkndll
Copy link
Copy Markdown
Contributor

@dnplkndll dnplkndll commented May 20, 2026

Port of mail_cleanup from 18.0 to 19.0. Follows the OCA migration guide.

Non-mechanical adaptations worth flagging:

  • fetchmail.server.connect() was renamed to _connect__() in Odoo 19 (and made internal); module callsite updated.
  • The module hooks earlier in the fetch path: overrides moved from fetch_mail(raise_exception=True) (now a thin access-check wrapper in core) to _fetch_mail(batch_limit=50) (the actual worker).
  • Tests added — the module shipped with no tests/ directory in 18.0 (and earlier). 7 tests now cover field declaration, server_environment integration, both cleanup branches, the no-folder branch, the IMAP/POP server-type gate, and the orchestration flow.

@legalsylvain legalsylvain marked this pull request as draft May 20, 2026 13:25
@dnplkndll dnplkndll force-pushed the 19.0-mig-mail_cleanup branch 3 times, most recently from a27b729 to 6c6614d Compare May 20, 2026 18:29
@dnplkndll dnplkndll marked this pull request as ready for review May 20, 2026 18:33
@dnplkndll
Copy link
Copy Markdown
Contributor Author

@leemannd @mymage

ready for review, added a couple of tests but still not clearing coverage

@dnplkndll dnplkndll force-pushed the 19.0-mig-mail_cleanup branch from 6c6614d to 45c8196 Compare May 20, 2026 22:31
Copy link
Copy Markdown
Contributor

@leemannd leemannd left a comment

Choose a reason for hiding this comment

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

Some bot commits should be squashed.
Unless that the code seems good.

Thanks for the unit test 👍

@dnplkndll dnplkndll force-pushed the 19.0-mig-mail_cleanup branch from 45c8196 to a96f6a1 Compare May 25, 2026 23:05
mdietrichc2c and others added 16 commits May 27, 2026 18:28
* Add new module "mail_cleanup" in order to move/mark as read old messages

* Use correct Model + remove unnecessary conditions/assignments

* Add purging mechanism + cleanup is by default inactive

* Add new field + new info in README

* Correct type for purge_days + better checks

* Place expunge() call after parsing all messages

* Migration to 9.0 of mail_cleanup

* Fix README.rst

* Add __init__.py

* Fix error with multi mail servers

* Correct syntax for methods + use datetime.date.today
Currently translated at 100.0% (8 of 8 strings)

Translation: server-tools-18.0/server-tools-18.0-mail_cleanup
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-mail_cleanup/it/
Currently translated at 100.0% (9 of 9 strings)

Translation: server-tools-18.0/server-tools-18.0-mail_cleanup
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-mail_cleanup/it/
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
@dnplkndll dnplkndll force-pushed the 19.0-mig-mail_cleanup branch from a96f6a1 to 6a5a96f Compare May 27, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants