From c3eb7f2a0f880ae68adad11121163649fc16bddd Mon Sep 17 00:00:00 2001 From: oihane Date: Mon, 2 Mar 2015 17:34:29 +0100 Subject: [PATCH] [MOD] Second step, quants merged when unreserving stock.move --- models/stock.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/models/stock.py b/models/stock.py index 8102185f2..c269edcb5 100644 --- a/models/stock.py +++ b/models/stock.py @@ -27,3 +27,10 @@ class StockQuant(models.Model): quant.unlink() self.cost += cost self.qty += qty + + @api.model + def quants_unreserve(self, move): + related_quants = [x for x in move.reserved_quant_ids] + super(StockQuant, self).quants_unreserve(move) + for quant in related_quants: + quant.merge_stock_quants()