From e33bcdec190479de452220c6f75510a36592315d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 28 May 2015 10:19:38 +0200 Subject: [PATCH] [FIX] stock: return picking wizard handles one picking at a time We force the user to select only one picking at a time. The reason is that we can choose the number of products to return for every picking, so it does not make sense to group the returns in one picking. opw-640030 --- addons/stock/wizard/stock_return_picking.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py index 46d523d7546..ab71d162ceb 100644 --- a/addons/stock/wizard/stock_return_picking.py +++ b/addons/stock/wizard/stock_return_picking.py @@ -63,6 +63,9 @@ class stock_return_picking(osv.osv_memory): result1 = [] if context is None: context = {} + if context and context.get('active_ids', False): + if len(context.get('active_ids')) > 1: + raise osv.except_osv(_('Warning!'), _("You may only return one picking at a time!")) res = super(stock_return_picking, self).default_get(cr, uid, fields, context=context) record_id = context and context.get('active_id', False) or False pick_obj = self.pool.get('stock.picking')