From 828418fc71dffbafd8164c52f93e4b8fca2737c5 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 16 Nov 2011 11:16:04 +0100 Subject: [PATCH] [REF] Make it clear that stock by location can process only one id bzr revid: ls@numerigraphe.fr-20111116101604-5f8nq014jvy1j4mm --- addons/stock/wizard/stock_location_product.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py index 8c0d3b4f0eb..2ac350cb108 100644 --- a/addons/stock/wizard/stock_location_product.py +++ b/addons/stock/wizard/stock_location_product.py @@ -34,13 +34,14 @@ class stock_location_product(osv.osv_memory): @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in - @param ids: An ID or list of IDs if we want more than one + @param ids: An ID or list of IDs (but only the first ID will be processed) @param context: A standard dictionary @return: Invoice type """ if context is None: context = {} - for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context): + location_products = self.read(cr, uid, ids, ['from_date', 'to_date'], context=context) + if location_products: return { 'name': False, 'view_type': 'form', @@ -48,8 +49,8 @@ class stock_location_product(osv.osv_memory): 'res_model': 'product.product', 'type': 'ir.actions.act_window', 'context': {'location': context.get('active_id'), - 'from_date': location_obj['from_date'], - 'to_date': location_obj['to_date']}, + 'from_date': location_products[0]['from_date'], + 'to_date': location_products[0]['to_date']}, 'domain': [('type', '<>', 'service')], }