Repository navigation
[16.0][ADD] pms: children capacity in rooms - #463
Open
jesusVMayor wants to merge 2 commits into
Open
jesusVMayor wants to merge 2 commits into
jesusVMayor wants to merge 2 commits into
Conversation
Rooms declared how many people fit, with no way to say how many of those places are for children only, such as child bunk beds. Children were meant to be counted through the reservation children_occupying, but nothing kept that field in sync with children and it was left empty, so children did not count towards the room capacity at all. Rooms get children_capacity now. capacity keeps its meaning, the places where anyone can sleep, and children take those first, overflowing into the children places only once they are full. Adults never occupy them, so a room with free children places can still be full for adults. Whether children take a place at all is up to the property, through the pms.children_occupy_capacity system parameter, and off unless it says otherwise: counting them refuses reservations that properties have been taking all along, so it cannot be something an upgrade decides for them. children_occupying is dropped. A reservation could declare an occupying child without counting it in children, so the migration folds it into children before the column goes away. Assisted-by: Claude Opus 5
The INE extra bed count subtracted the children occupying the room from the extra beds sold for that date. Nothing ever filled children_occupying in, so the subtraction always took zero, and the field is gone now. Assisted-by: Claude Opus 5
jesusVMayor
force-pushed
the
16.0-add-room-children-capacity
branch
from
October 9, 2026 09:52
4cb2ec4 to
875b006
Compare
2 tasks
This was referenced Oct 28, 2026
[WIP][16.0][ADD] connector_pms_channex: publish rates and restrictions
commitsun/roomdoo-modules#189
Draft
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.
Rooms declared how many people fit, with no way to say how many of those
places are for children only, such as child bunk beds.
Children were meant to be counted through
pms.reservation.children_occupying,a plain integer with no compute, default or constraint. Nothing kept it in sync
with
children, so it was left empty and children did not count towards theroom capacity at all: a double room took two adults and any number of children
without complaint. The demo data of this very module books an adult and a child
into a single room because of it.
What this does
pms.roomgetschildren_capacity.capacitykeeps its meaning, the placeswhere anyone can sleep, and children take those first, overflowing into the
children places only once they are full. Adults never occupy them, so a room
with free children places can still be full for adults.
This is the bed space model channel managers work with, where adult spaces hold
anyone and children spaces only children.
The two places that checked the capacity duplicated the formula; both call
pms.room.fits_occupancy()now.Nothing changes unless the property asks for it
Counting children refuses reservations that properties have been taking all
along, so it is off unless the new
pms.children_occupy_capacitysystemparameter says otherwise. With it off the behaviour is exactly the current one.
See
readme/CONFIGURE.rst.children_occupyingis droppedA reservation could declare an occupying child without counting it in
children, so the migration folds it in before the column goes away, or thosechildren would be lost.
pms_l10n_essubtractedchildren_occupyingfrom the extra beds of the INEreport. As the field was never filled in, the subtraction always took zero and
no past report changes.
Tests
New tests cover that children do not occupy by default, that they overflow into
the children places when the parameter is on, and that adults never take those
places. The existing
test_manage_children_raiseturns the parameter on andnow asserts the reason, as a bare
assertRaises(ValidationError)was passingfor an unrelated validation.