Skip to content

[19.0][MIG] mail_notify_employee_leave: Migration to 19.0#228

Open
GuillermoNforgeflow wants to merge 7 commits into
OCA:19.0from
ForgeFlow:19.0-mig-mail_notify_employee_leave
Open

[19.0][MIG] mail_notify_employee_leave: Migration to 19.0#228
GuillermoNforgeflow wants to merge 7 commits into
OCA:19.0from
ForgeFlow:19.0-mig-mail_notify_employee_leave

Conversation

@GuillermoNforgeflow

@GuillermoNforgeflow GuillermoNforgeflow commented Jul 7, 2026

Copy link
Copy Markdown

mail_tracking's test_access_tracking_email failed on this branch because deferred notifications aren't sent synchronously: the test posts a message and immediately checks the mail.tracking.email, which doesn't exist yet when mail_post_defer defers it. (The test only runs when hr is installed, which is the case here)

Fix: mail_post_defer now skips deferring under test_enable unless a test opts in via the test_mail_post_defer context key. Its own tests set that key to keep testing the deferral. No changes needed in mail_tracking.

@OCA-git-bot OCA-git-bot added series:19.0 mod:mail_notify_employee_leave Module mail_notify_employee_leave labels Jul 7, 2026
@GuillermoNforgeflow GuillermoNforgeflow force-pushed the 19.0-mig-mail_notify_employee_leave branch from d2c89f6 to 5ecc9a8 Compare July 7, 2026 06:50
@GuillermoNforgeflow GuillermoNforgeflow force-pushed the 19.0-mig-mail_notify_employee_leave branch from 5ecc9a8 to 560bf0b Compare July 7, 2026 06:56
@OCA-git-bot OCA-git-bot added the mod:mail_post_defer Module mail_post_defer label Jul 7, 2026
@GuillermoNforgeflow GuillermoNforgeflow force-pushed the 19.0-mig-mail_notify_employee_leave branch from 6651da4 to 23a86bb Compare July 7, 2026 09:07
@GuillermoNforgeflow GuillermoNforgeflow force-pushed the 19.0-mig-mail_notify_employee_leave branch from 23a86bb to 51691af Compare July 7, 2026 09:19

@GuillemCForgeFlow GuillemCForgeFlow 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.

code review lgtm 👍🏿

Comment on lines +15 to +17
# During tests, don't defer unless a test explicitly opts in
if config["test_enable"] and not self.env.context.get("test_mail_post_defer"):
return super()._notify_thread(message, msg_vals=msg_vals, **kwargs)

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.

this solution makes sense 👍🏿 otherwise we are deferring also in tests, which we only want to do when explicitly checking in tests, such as in the actual module's tests

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

Labels

mod:mail_notify_employee_leave Module mail_notify_employee_leave mod:mail_post_defer Module mail_post_defer series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants