[16.0][BKP] stock_reserve_sale: backport to v16 #2684
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 440 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.364
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2684"
general
weight: 0.35
eduezerouali-tecnativa
Back-port of
stock_reserve_saleto 16.0, plus a few improvements on top.The module was never merged in 16.0 (#1695 and #1788 were closed). This branch carries the whole history of the module from 17.0.
[MIG] stock_reserve_sale: back-port to 16.0
Adapts the 17.0 module to 16.0
[IMP] stock_reserve: picking type from location warehouse
Reservations always got the first delivery type of the company, whatever their source location. A new
_get_picking_type(location, company_id)method returns the delivery type of the source location's warehouse, and falls back to the company's first delivery type when the location is not in a warehouse.default_getuses it.[IMP] stock_reserve_sale: use source location picking type
The reservation transfer used the delivery type of the sale order's warehouse, even when stock was reserved from another warehouse. The wizard now uses
_get_picking_typewith the source location, and also sets the picking type on the reservation, so the move and its transfer always match.[IMP] stock_reserve_sale: add stock reservation policy
New company setting Stock Reservation Policy in Sales > Configuration > Settings > Quotations & Orders:
Availability is computed the same way Odoo does when reserving: free quantity in the source location and its children. Consumable products and locations that do not track stock always use the ordered quantity.
[IMP] stock_reserve_sale: make reservation transfers optional
New company setting Reservation Transfers (enabled by default, previous behaviour). When disabled, reservations are created as plain stock moves without a delivery transfer, as in
stock_reserve. This avoids reservation transfers showing up among the deliveries, where they could be validated by mistake.[IMP] stock_reserve_sale: add lines to the reservation wizard
New transient model
sale.stock.reserve.line. The wizard lists the lines to reserve with their ordered quantity, the quantity available in the source location and the quantity to reserve. That quantity defaults according to the reservation policy and can be changed, and it is checked against the policy. Lines that will not be fully reserved are highlighted, so the user sees a partial reservation before confirming. The ROADMAP is updated accordingly.[FIX] stock_reserve_sale: compute all lines reserved per line
Comparing the number of reservations with the number of lines fails
when a line has several reservations, as the components of a kit do:
the order can be flagged as fully reserved while a line is not, or the
other way around. Check instead that every line has a reservation.
It ensures the logic is fine also when using https://github.com/OCA/stock-logistics-warehouse/pull/2686
[IMP] stock_reserve_sale: default to order warehouse location
The source location of the reservation wizard defaulted to the stock
location of the first warehouse of the company, whatever the warehouse
of the sale order. Default to the stock location of the warehouse of the
selected sale orders instead, and keep the previous default when they
belong to different warehouses.