← Back to Pull requests

[20.0][MIG] stock_move_valuation_usage: Migration to 20.0 #2578

Open
unknown opened this pull request with 151 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 18, 2026 07:38 UTC
Author

Standard Migration

Changes for Odoo 20.0:

  • Core now values outgoing moves after _action_done() and replays the FIFO valuation (_run_fifo(correction=True)) when an earlier move changes (date, quantity, cost) or a receipt fills stock that was already delivered. The usage records are now rebuilt on every valuation of an outgoing FIFO move and on every replay (through the new _run_fifo_correction_reset() hook of stock_account_product_run_fifo_hook), so they follow the move value and are never duplicated.

  • Removed _handle_negative_fifo_revaluation(): it linked every delivery without usage records to the next receipt, for the full delivered quantity. The replay now links the receipt to the deliveries it fills, for the filled quantity only.

  • Removed the _set_value() override: stock_account_product_run_fifo_hook now sets the valued_move context.

  • tools.create_index() replaced by models.Index (same index name).

  • Security files merged into security/ir.access.csv.

  • Tests rewritten on TestStockValuationCommon (the category valuation fields were removed in 20.0): negative stock fill, FIFO replay (cost update, backdating), batch validation and no duplicated records.
  • @ForgeFlow

    Diff: 151 lines (+113 / -38) across 1 files Reviewer: AaronHForgeFlow Review duration: 21261m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.56) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.56 · 151 lines diff across 1 files
    0.56
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.301
    Sensitive Paths sensitive_paths
    0.056
    Real PR Conversation Timeline
    1 comments
    "Review active on #2578"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 56.2% (MEDIUM) · Higher = larger blast radius
    56.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.0% · Safe to merge
    30.0%