Skip to content

Syncing from upstream OCA/credit-control (18.0) - #718

Merged
bt-admin merged 6 commits into
brain-tec:18.0from
OCA:18.0
Sep 17, 2026
Merged

bt-admin merged 6 commits into
brain-tec:18.0from
OCA:18.0

Conversation

@bt-admin

Copy link
Copy Markdown

bt_gitbot

carlosdauden and others added 6 commits September 10, 2026 17:21
…date reference in tests

_max_risk_date_due() computes the "today" boundary with
fields.Date.context_today() (timezone-aware: this env's admin user
defaults to Europe/Brussels), while the tests date-stamp their records
with the naive fields.Date.today(). Whenever the real wall-clock instant a
test runs at falls within the user's timezone offset window around
midnight UTC, the two disagree by a day, pushing a record dated "today"
out of the "open" (not yet due) bucket the assertions expect it in -
reproduced 2026-09-09 close to midnight UTC, and confirmed reproducible on
demand by freezing at an unsafe instant (23:30 UTC) before settling on a
safe one.

Two changes, both needed: freeze time at a fixed, safe instant (noon UTC,
clear of any realistic timezone offset crossing a day boundary) with
freezegun's @freeze_time, already used the same way throughout this
codebase for date-dependent OCA tests, so the test's result no longer
depends on real wall-clock time at all; and use
fields.Date.context_today(cls.env.user) instead of the naive
fields.Date.today() for the test's own date references, so it exercises
the exact same date computation _max_risk_date_due() itself uses rather
than one that merely happens to agree with it under the current freeze.
…isn't installed

test_payment_risk_bypass drives PaymentHttpCommon._get_portal_pay_context(),
which does a real HTTP GET to /payment/pay - a website=True route
(odoo/addons/payment/controllers/portal.py), 404ing whenever the website
module isn't installed. Neither this module nor its declared dependencies
(sale, account_financial_risk) require website, so an install that
deliberately doesn't carry it (this project's, among others) fails this
test on a dependency the manifest never declared. Skip it explicitly
instead, the same way other tests in this codebase skip on a genuinely
optional dependency.
Signed-off-by pedrobaeza
Signed-off-by pedrobaeza
@bt-admin bt-admin added the 18.0 label Sep 17, 2026
@bt-admin
bt-admin merged commit d2e58e3 into brain-tec:18.0 Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants