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

[FIX] stock: check SN uniqueness by location


To reproduce the issue:
1. In Settings, enable:
   - Storage Locations
   - Package
2. Create a product P
   - Type: Storable
   - Tracked by SN
3. Process a receipt with 1 x P, serial S
4. Return P in a package
5. Process a new receipt with 1 x P, still S as SN

Error: An error is displayed "The serial number has already been
assigned [...]". This is incorrect, the user should be able to
receive that SN.

After step 3, there exists a quant Q1: -1 x P at Supplier Location
with S. Then, after step 4, a new quant Q2 is created: 1 x P at
Supplier Location with S and the package. Because the field
`package_id` is not the same on Q1 and Q2, both quants are not merged.

As a result, step 5, we will update Q1 and have -2 x P at Supplier
Location with S. This will trigger the constraint, hence the error
message.

OPW-3390615

closes odoo/odoo#134478

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent e56d2071
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