[19.0][MIG] stock_exception: migration to 19.0 and adaptation to the new base_exception flow #2585
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.70) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.70 · 483 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.070
Real PR Conversation Timeline
1 comments
"Review active on #2585"
general
weight: 0.35
bosd
Migration of
stock_exceptionto 19.0, adapted to the currentbase_exception.Why this instead of #2185
#2185 by @JordiMForgeFlow did the migration, and the stale bot closed it on 2026-09-27 without anyone reviewing it. This PR carries its commits unchanged, rebased on the current 19.0, and adds on top the adaptation the module needs: as it stood,
stock_exceptionstill drives the pre-refactor mechanism and silently stops working once thebase_exceptionchanges of #3590 and the ones that followed are in (forward ported in #3879).@JordiMForgeFlow, happy to close this one if you would rather reopen yours and take the last commit.
The adaptation
detect_exceptions()no longer returns the exceptions: it stores them and raisesBaseExceptionError, and the popup is opened by the client error handler throughaction_popup_exceptions().action_confirm()andbutton_validate()just run the detection and let the error stop the flow, instead of reading its return and opening the popup themselves, which with the new mechanism never happened._must_popup_exception()returns True. Without it the defaultFalseturns the error into a soft reload: the transfer stays in draft and the user is never told why.stateconstraint (the transfer may not be committed yet, for example one created by a sale order confirmation, and the second cursor would fail withMissingError) and the cron, which otherwise stopped on the first transfer with an exception.super().detect_exceptions()now raises as soon as it finds one, so they were skipped and a blocking move exception could be ignored together with the others.sale_exceptiondoes with the order lines. Otherwise the client falls back to a soft reload and the user is not told why.base_exception_no_rollback, since the normal flow keeps them in a transaction of its own and rolls this one back.On top of the migration the module also gets demo data (a customer on credit hold with a warning rule on the transfer and a blocking one on its moves, so runboat has something to show: every shipped rule is archived), the CONFIGURE and USAGE fragments, the new OCA icon and a
.pocleanup.Thanks @bosd for the review, the fixes and the documentation: adhoc-dev/stock-logistics-workflow#2, merged here commit by commit.
Test plan
Run on an Odoo 19 database with
base_exceptionat the state of #3879:CI runs them with
base_exceptionfrom #3879, see Depends on: 10 tests, no failures, with Odoo and with OCB.Depends on
_must_popup_exception(),base_exception_no_rollbackandBaseExceptionErrorcome from #3879, the forward port of thebase_exceptioncommits that are in 18.0 and missing in 19.0. Until that is merged, CI and runboat take it from the PR through the first commit of this one,[DO NOT MERGE] test-requirements.txt, which has to be dropped before merging. That is what makes the test jobs and runboat meaningful here, at the price of Detect unreleased dependencies, which is red by design while that commit is in.Known limitation
After Ignore Exceptions in the popup, the wizard always calls
action_confirm(). When the popup came from Validate, the transfer is not validated and the user has to click Validate again. This is the behaviour of the module as it was, kept as is here and described in USAGE.