[16.0][FIX] pms: autocheckout - replace deprecated message_post subtype kwarg#399
Merged
OCA-git-bot merged 1 commit intoMay 16, 2026
Conversation
The 'subtype' kwarg of message_post() was removed in Odoo 16: it now
requires either 'subtype_id' (int) or 'subtype_xmlid' (str).
Replace 'subtype="mt_comment"' with 'subtype_xmlid="mail.mt_comment"'
so the cron "Automatic No Checkout Reservations" stops failing with:
ValueError: message_post does not support subtype parameter
anymore. Please give a valid subtype_id or subtype_xmlid value
instead.
Member
Author
|
/ocabot merge minor |
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at 53c93a0. Thanks a lot for contributing to OCA. ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
PmsReservation.autocheckout()which was using the deprecatedsubtypekwarg ofmessage_post(), causing the cron Automatic No Checkout Reservations to fail with:The
subtypekwarg was removed in Odoo 16. It now requires eithersubtype_id(int) orsubtype_xmlid(str).Change
Note also that the legacy
"mt_comment"was implicitly assumed to be prefixed withmail.; the explicit xmlid"mail.mt_comment"keeps the same behavior.Reproduction
Trigger the
Automatic No Checkout Reservationscron (server_action #341in default install) — any reservation reaching the autocheckout path without confirmed check-ins raises the ValueError instead of posting the chatter message and marking the reservation.Test plan