[FIX] pos_sale: Pick from reserved stock.move.line
Usecase to reproduce:
- Set reservation method to closest location
- Set the POS as real time stock
- Put 1 unit in A and 1 unit in location B
- Create a SO for 1 unit
- Sell it in the POS
Expected behavior:
The unit has been taken from the reservation in location A
Current behavior:
The unit is taken from B
It happens because the SO is unreserved after the new picking
and stock.move.line creation. Since the unit is reserved, he
can't pick it and take a random ones.
The solution here is to unreserve the related stock.move to
free the reserved unit, it will not always be the same than the
SO but it will consider it in the removal strategy. It could
also fix the case where only 1 unit remains in stock and he won't
pick it.
opw-3271217
closes odoo/odoo#121695
Signed-off-by:
Engels Robin (roen) <roen@odoo.com>
Showing
- addons/pos_sale/models/__init__.py 1 addition, 0 deletionsaddons/pos_sale/models/__init__.py
- addons/pos_sale/models/stock_picking.py 19 additions, 0 deletionsaddons/pos_sale/models/stock_picking.py
- addons/pos_sale/static/tests/tours/pos_sale_tours.js 13 additions, 0 deletionsaddons/pos_sale/static/tests/tours/pos_sale_tours.js
- addons/pos_sale/tests/test_pos_sale_flow.py 73 additions, 0 deletionsaddons/pos_sale/tests/test_pos_sale_flow.py
Loading
Please register or sign in to comment