← Back to Pull requests

[18.0][ADD] barcode_stock_picking_back2draft #20

Open
unknown opened this pull request with 281 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 06, 2026 04:03 UTC
Author

Summary

barcode_stock_picking_back2draft exposes the existing Back to draft action of stock_picking_back2draft in the Odoo Barcode app.

A canceled transfer can now be reopened from the Barcode picking screen and reset to draft: tap BACK TO DRAFT, confirm the dialog, and the transfer is reset while Barcode returns to the picking list. The action is only offered for canceled transfers.

Canceled transfers are also listed in the Barcode picking list, but they are hidden by default and only shown when the operator explicitly selects the Cancelled state filter, so they do not clutter the normal picking queue.

Why

stock_picking_back2draft already allows returning a canceled transfer to draft from the backend. Doing it from the Barcode app avoids sending the operator back to the office for a common correction (for example, a transfer canceled by mistake or canceled to change its operations), keeping the barcode workflow uninterrupted.

Reference: @BinhexTeam T26643

Dependencies

  • barcode_stock (this repository)

  • stock_picking_back2draft (OCA/stock-logistics-workflow)
  • Usage

    1. Install barcode_stock_picking_back2draft. It auto-installs when barcode_stock and stock_picking_back2draft are present.
    2. Open the Barcode app and go to the picking list of an operation type.
    3. Optionally filter by Cancelled to show canceled transfers.
    4. Open a canceled transfer and tap BACK TO DRAFT.
    5. Confirm the dialog: the transfer is set back to draft, a success notification is shown, and Barcode returns to the picking list.
    6. Open the transfer again from the backend to confirm it and reserve stock as usual.

    How to test

    Manual:

    1. Install barcode_stock_picking_back2draft.
    2. Create and confirm a transfer, then cancel it.
    3. Open the Barcode app and check that the canceled transfer is not listed by default.
    4. Select the Cancelled state filter and check that the transfer appears.
    5. Open it, tap BACK TO DRAFT and confirm. Check the success notification and that Barcode returns to the picking list.
    6. Check in the backend that the transfer is back in draft and can be confirmed again.
    7. Check that a non-canceled transfer does not show the BACK TO DRAFT button.

    Diff: 281 lines (+210 / -71) across 3 files Reviewer: edescalona Review duration: 36022m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 281 lines diff across 3 files
    0.40
    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%
    42%
    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.338
    Real PR Conversation Timeline
    1 comments
    "Review active on #20"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    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: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 22.6% · Safe to merge
    22.6%