[16.0][FIX] pos_pms_link: offer reservations whose stay covers today - #446
Merged
OCA-git-bot merged 1 commit intoSep 7, 2026
Merged
Conversation
The POS reservation list was loaded with this domain:
["|", ("state", "=", "onboard"),
"&", ("checkout", "=", now().date()), ("state", "!=", "cancel")]
so a reservation only reached the POS while it was onboard, or on its very
last day. A stay that is confirmed but not yet checked in was invisible, and
the cashier could not charge a consumption to it.
That is reasonable for a hotel, where every guest is checked in on arrival.
It makes the feature unusable for long stays: a reservation spanning weeks or
months sits in 'confirm' for its whole duration unless somebody performs a
check-in, and a monthly-split stay gets a fresh segment whose checkout is
weeks away. On a residence hall the list came up empty every single day.
Load instead every non-cancelled reservation whose stay covers today, which
is the single question the POS needs answered: can I charge this consumption
to somebody who is staying right now.
The explicit 'onboard' branch is dropped rather than kept as an alternative.
It only ever added reservations that are onboard outside their own dates, and
auto_departure_delayed() already moves those to 'departure_delayed' on the
checkout day and auto-checks them out afterwards. The one case that behaves
differently is an instance whose nocheckout_reservations cron is disabled: an
overstay left in 'onboard' past its checkout is no longer offered, and its
dates have to be corrected first.
Also use fields.Date.context_today() instead of fields.Datetime.now().date().
The latter is UTC, so in a positive-offset timezone the date rolls over before
local midnight and the evening shift loads the wrong day.
DarioLodeiros
force-pushed
the
16.0-fix-pos_pms_link-reservations-by-date
branch
from
September 4, 2026 10:13
c055f1e to
fc8f1b3
Compare
Member
Author
|
/ocabot merge minor |
Contributor
|
What a great day to merge this nice PR. Let's do it! |
Contributor
|
@DarioLodeiros The merge process could not be finalized, because command |
Member
Author
|
/ocabot merge minor |
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at 05bc0d2. 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.
Problem
pos.session._loader_params_pms_reservation()loads the reservations offered in the POS with this domain:A reservation therefore reaches the POS only while it is
onboard, or on its very last day. A stay that is confirmed but not yet checked in never appears, so the cashier cannot charge a consumption to it and the reservation-selection screen opens on an empty list.That is reasonable for a hotel, where every guest is checked in on arrival. It makes the feature unusable for long stays: a reservation spanning weeks or months sits in
confirmfor its whole duration unless somebody performs a check-in, and a monthly-split stay gets a fresh segment whose checkout is weeks away. On a residence hall with ~250 rooms occupied for the whole academic year, the list was empty every single day.Fix
Load every non-cancelled reservation whose stay covers today, which is the single question the POS needs answered: can I charge this consumption to somebody who is staying right now.
checkout >= todaykeeps the departure day included, which the old domain handled with itscheckout == todaybranch, so a guest who checked out this morning can still be charged for breakfast.This also replaces
fields.Datetime.now().date()withfields.Date.context_today(). The former is UTC, so in a positive-offset timezone the date rolls over before local midnight and the evening shift loads the wrong day.On dropping the explicit
onboardbranchI did first keep
onboardas an alternative, and then removed it because it earns nothing: the only reservations it adds are those that areonboardoutside their own dates, andauto_departure_delayed()already moves those todeparture_delayedon the checkout day and auto-checks them out afterwards.So this is not a strict superset of the old behaviour, and it is worth being explicit about the one case that changes: on an instance whose
nocheckout_reservationscron is disabled, an overstay left inonboardpast its checkout is no longer offered in the POS, and its dates have to be corrected first. I think that is the right trade — charging a consumption to a stay that the system believes ended yesterday hides the real problem — but I am happy to put the branch back if maintainers prefer strict compatibility.How to reproduce
confirmand not checked in.Before: the list is empty. After: the reservation is listed with its guest name, rooms and services.