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

[FIX] stock: ensure destination location of SML

To reproduce the issue:
(Use demo data)
1. In Settings, enable "Multi Locations"
2. Create a storable and tracked-by-lot product P
3. Create an immediate receipt R
4. Add a line for 1 x P and save
5. Open the wizard 'Detailed Operations' and add a line:
   - 1 x P, lot 123, to WH/Stock/Shelf 1
6. Save
7. Open the wizard again

Error: The destination location of the line is now WH/Stock

When creating the SML, because we write on its done quantity, we
will automatically write the same on the new done quantity of the SM
on the demand of that SM. Doing so, it will trigger the assign
process:
https://github.com/odoo/odoo/blob/57ac92fc4c14bf305ffd9ef98212cc80013345f5/addons/stock/models/stock_move.py#L599-L602
(And it will therefore lead to the putaway rules feature)

Once the above issue is fixed, there will be another one. When
marking the SML as done, if it's needed, we assign it a lot. However,
writing on such a field will trigger the reservation process:
https://github.com/odoo/odoo/blob/c9fdd4f2ac2d8afb18cb0dd126bb0b88c54f374e/addons/stock/models/stock_move_line.py#L330-L333


And it will lead, again, to the putaway rules feature

OPW-3086704

closes odoo/odoo#112267

X-original-commit: 86b78b2a4a8bc350d7df19e6786bf4ee00021457
Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
parent ca8e7aed
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment