From 6cf485fc5c6d79dace9bacdb4fd03aaf7ff0afa6 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Fri, 14 Feb 2014 11:24:26 +0100 Subject: [PATCH] [IMP] Do not take into account package check for negative quants and no make to stock for split by default bzr revid: jco@openerp.com-20140214102426-o0njdd3fnme9f54p --- addons/stock/stock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 326ca787d98..bcb3261675f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1903,7 +1903,7 @@ class stock_move(osv.osv): pack_obj = self.pool.get("stock.quant.package") packs = set() for move in self.browse(cr, uid, ids, context=context): - packs |= set([q.package_id.id for q in move.quant_ids if q.package_id]) + packs |= set([q.package_id.id for q in move.quant_ids if q.package_id and q.qty > 0]) return pack_obj._check_location_constraint(cr, uid, list(packs), context=context) def action_done(self, cr, uid, ids, context=None): @@ -2065,7 +2065,6 @@ class stock_move(osv.osv): 'product_uom_qty': uom_qty, 'product_uos_qty': uos_qty, 'state': move.state, - 'procure_method': 'make_to_stock', 'move_dest_id': False, 'reserved_quant_ids': [], 'restrict_lot_id': restrict_lot_id, @@ -3259,7 +3258,7 @@ class stock_package(osv.osv): quant_ids = self.get_content(cr, uid, [parent.id], context=context) quants = quant_obj.browse(cr, uid, quant_ids, context=context) location_id = quants and quants[0].location_id.id or False - if not all([quant.location_id.id == location_id for quant in quants]): + if not all([quant.location_id.id == location_id for quant in quants if quant.qty > 0]): raise osv.except_osv(_('Error'), _('Everything inside a package should be in the same location')) return True