From 581184272496e1df41a2e26f776ddc9df1e3ba0e Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 28 Jan 2014 17:58:47 +0100 Subject: [PATCH] [IMP] Negative quants reserve raise error bzr revid: jco@openerp.com-20140128165847-uw13d6bvdljzgswg --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4510815a090..e306538d60a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -292,6 +292,8 @@ class stock_quant(osv.osv): toreserve = [] #split quants if needed for quant, qty in quants: + if qty < 0.0: + raise osv.except_osv(_('Error!'), _('You can not reserve negative quants. ')) if not quant: continue self._quant_split(cr, uid, quant, qty, context=context)