Skip to content
Snippets Groups Projects
Commit ac11b7e0 authored by Adrien Widart (awt)'s avatar Adrien Widart (awt)
Browse files

[FIX] mrp: include unscrapped SN when checking uniqueness


It is not possible to consume a component tracked by serial that comes
back from a scrap location

To reproduce the issue:
1. In Settings, enable "Multi Routes"
2. Create two storable products P_compo, P_finished
    - P_compo is tracked by serial number
3. Update the on-hand qty of P_compo:
    - 1 x P_compo with serial SN
4. Process a manufacturing order MO:
    - Product: P_finished
    - Compo: 1 x P_compo with SN
5. Unbuild P_finished
    - It brings SN back to stock
5. Scrap one P_compo with SN
6. Unscrap it (thanks to an internal transfer)
7. Repeat step 4

Error: a user error is raised: "The serial number SN used for component
P_compo has already been consumed"

When checking the SN uniqueness of a component, we don't consider the
case where a product came back from a srap location

OPW-3055252

closes odoo/odoo#105843

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 402dfd0a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment