Skip to content

[FIX] test_booking_engine: assign calendar to overbooking test resource#2210

Closed
fw-bot wants to merge 1 commit into
odoo:saas-19.1from
odoo-dev:saas-19.1-19.0-booking-engine-test-fix-chga-527452-fw
Closed

[FIX] test_booking_engine: assign calendar to overbooking test resource#2210
fw-bot wants to merge 1 commit into
odoo:saas-19.1from
odoo-dev:saas-19.1-19.0-booking-engine-test-fix-chga-527452-fw

Conversation

@fw-bot
Copy link
Copy Markdown

@fw-bot fw-bot commented May 22, 2026

Before PR:

The test resource was created without an explicit calendar assignment. As a result, the default Standard 40 hours/week calendar was automatically assigned, making the resource available only from Monday to Friday.

Also, the rental start date is set as today + 1 here [1] Because of this, when the test runs on Friday, the start date becomes Saturday. Since the resource is unavailable on weekends, the test fails with a 'resource not available' error. link[1]:

cls.start_date = datetime.today() + timedelta(days=1)
cls.end_date = datetime.today() + timedelta(days=2)

After PR:

Explicitly assign calendar_id as False to the test resource. Since this calendar keeps the resource available on all days of the week, the test no longer depends on the weekday it runs on.

Forward-Port-Of: #2182

Before PR:
The test resource was created without an explicit calendar
assignment. As a result, the default `Standard 40 hours/week`
calendar was automatically assigned, making the resource
available only from Monday to Friday.

Also, the rental start date is set as `today + 1` here [1]
Because of this, when the test runs on Friday, the start date
becomes Saturday. Since the resource is unavailable on weekends,
the test fails with a 'resource not available' error.
link[1]: https://github.com/odoo/industry/blob/d442610935aa38adcf7b735cdd6e0dab1154c746/tests/test_booking_engine/tests/test_overbooking.py#L47-L48

After PR:
Explicitly assign calendar_id as False to the test
resource. Since this calendar keeps the resource available on
all days of the week, the test no longer depends on the weekday
it runs on.

X-original-commit: 06ac86b
@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 22, 2026

Pull request status dashboard

@fw-bot
Copy link
Copy Markdown
Author

fw-bot commented May 22, 2026

This PR targets saas-19.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot
Copy link
Copy Markdown
Author

fw-bot commented May 22, 2026

@chga-odoo @vava-odoo ci/industry failed on this forward-port PR

@vava-odoo
Copy link
Copy Markdown
Collaborator

@robodoo override=ci/industry
@robodoo r+

robodoo pushed a commit that referenced this pull request May 22, 2026
Before PR:
The test resource was created without an explicit calendar
assignment. As a result, the default `Standard 40 hours/week`
calendar was automatically assigned, making the resource
available only from Monday to Friday.

Also, the rental start date is set as `today + 1` here [1]
Because of this, when the test runs on Friday, the start date
becomes Saturday. Since the resource is unavailable on weekends,
the test fails with a 'resource not available' error.
link[1]: https://github.com/odoo/industry/blob/d442610935aa38adcf7b735cdd6e0dab1154c746/tests/test_booking_engine/tests/test_overbooking.py#L47-L48

After PR:
Explicitly assign calendar_id as False to the test
resource. Since this calendar keeps the resource available on
all days of the week, the test no longer depends on the weekday
it runs on.

closes #2210

X-original-commit: 06ac86b
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
@robodoo robodoo closed this May 22, 2026
@fw-bot fw-bot deleted the saas-19.1-19.0-booking-engine-test-fix-chga-527452-fw branch May 29, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants