From 64ce2476c14244aa9218df12f39590b0ef217fe4 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 21 Nov 2011 17:33:36 +0100 Subject: [PATCH] [REF] stock, location_product wizard: context['active_id'] instead of context.get('active_id'). This syntax change is to emphasize the fact that active_id _is_ required in the context when reaching this line. So it's better to crash directly if it's not there. Courtesy from xmo bzr revid: qdp-launchpad@openerp.com-20111121163336-2pn5hcub4qs3klx1 --- addons/stock/wizard/stock_location_product.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py index 2ac350cb108..49dc048d0ab 100644 --- a/addons/stock/wizard/stock_location_product.py +++ b/addons/stock/wizard/stock_location_product.py @@ -43,15 +43,15 @@ class stock_location_product(osv.osv_memory): location_products = self.read(cr, uid, ids, ['from_date', 'to_date'], context=context) if location_products: return { - 'name': False, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'product.product', - 'type': 'ir.actions.act_window', - 'context': {'location': context.get('active_id'), - 'from_date': location_products[0]['from_date'], - 'to_date': location_products[0]['to_date']}, - 'domain': [('type', '<>', 'service')], + 'name': False, + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'product.product', + 'type': 'ir.actions.act_window', + 'context': {'location': context['active_id'], + 'from_date': location_products[0]['from_date'], + 'to_date': location_products[0]['to_date']}, + 'domain': [('type', '<>', 'service')], } stock_location_product()