From a4194005bef2e76efaafa13976ed684ff2f053b4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 10 Nov 2015 11:51:45 +0100 Subject: [PATCH] [FIX] stock: unreserve quants before assignment Make sure to unreserve all quants before assignment. Indeed, the method makes this assumption and does not take into account any existing reserved quants. Therefore, without this fix, there is a possibility to reserve more than needed. opw-653904 --- addons/stock/stock.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 69d51eea942..c2080827fb0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2345,6 +2345,7 @@ class stock_move(osv.osv): main_domain = {} todo_moves = [] operations = set() + self.do_unreserve(cr, uid, [x.id for x in self.browse(cr, uid, ids, context=context) if x.reserved_quant_ids and x.state in ['confirmed', 'waiting', 'assigned']], context=context) for move in self.browse(cr, uid, ids, context=context): if move.state not in ('confirmed', 'waiting', 'assigned'): continue