summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2018-04-25 14:13:56 +0200
committerSimon Lejeune <sle@openerp.com>2018-04-30 11:05:33 +0200
commit4322985a8aa7c5d007ebef4d227b5ef4c4d971fe (patch)
treed3fb72b5d40cb14a3f6dbb2a68bb569171e4af6f /addons/web/static/src
parent0e28b858e0b648166c726b438419884f45b9c78a (diff)
[FIX] stock: rounding issues
Followup of rev 383947646f5652804bd6bbc764380a890e6f4a8d Let's say you have 6 units and you try to reserve a dozen while the rounding of the dozen is 1.0. The previous commit correctly only allows to reserve 12 units, and handle correctly forced quantities in other compatible UOM, all that with extra moves/backoders. But we missed an important issue: if now you have 12 units, you will reserve them. If these 12 units are split across quants, i.e. some are in another sublocations or are assigned a special lot_id, then we'll again have rounding issue because the reservation was always expressed in the move's uom while sometimes it is not possible to go back and forth between the move uom and and the product's uom. In other word, we'll reserve 12 times 0 dozen and get stuck at the next step. This patch now only reserve a quantity if the quantity is expressible in the rounding's UOM. If this quantity is split across multiple move lines, we'll make the move line reserved in the UOM of the quants if necessary. We also do not apply the rounding down -> halfup dance if `_update_reserved_quantity` is called with the force argument set as True (meaning, in an mto scenario). The change in `_prepare_move_line_vals` will make the move lines in the uom of the qants and everything should be good. With the last change, we need to adapt the test added by the previous patch, else we won't be able to make a chain of 2 move moving producst tracked by serial number if the rounding of the dozen is set at 1.0. opw-1835186 opw-1835946
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions