From bb3743070d2840750b57675f64c3f95824d948b7 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 23 Sep 2008 13:25:21 +0200 Subject: [PATCH] improvement bzr revid: fp@tinyerp.com-20080923112521-gd45nckoeqq29jmx --- addons/product/product.py | 9 ++++--- .../stock/wizard/wizard_location_product.py | 25 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 671433bd0fe..627bbf75c51 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -329,10 +329,11 @@ product_template() class product_product(osv.osv): def view_header_get(self, cr, uid, view_id, view_type, context): res = super(product_product, self).view_header_get(cr, uid, view_id, view_type, context) - if res: return res - if (not context.get('categ_id', False)): - return False - return _('Products: ')+self.pool.get('product.category').browse(cr, uid, context['categ_id'], context).name + if (context.get('categ_id', False)): + return _('Products: ')+self.pool.get('product.category').browse(cr, uid, context['categ_id'], context).name + if (context.get('location', False)): + return _('Products: ')+self.pool.get('stock.location').browse(cr, uid, context['location'], context).name + return res def _product_price(self, cr, uid, ids, name, arg, context={}): res = {} diff --git a/addons/stock/wizard/wizard_location_product.py b/addons/stock/wizard/wizard_location_product.py index 0083c0e9863..f6190c023d2 100755 --- a/addons/stock/wizard/wizard_location_product.py +++ b/addons/stock/wizard/wizard_location_product.py @@ -34,24 +34,27 @@ import time def _action_open_window(self, cr, uid, data, context): return { - 'view_type': 'form', - "view_mode": 'tree,form', - 'res_model': 'product.product', - 'type': 'ir.actions.act_window', - 'context':{'location': data['ids'][0],'from_date':data['form']['from_date'],'to_date':data['form']['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': data['ids'][0],'from_date':data['form']['from_date'],'to_date':data['form']['to_date']}, + 'domain':[('type','<>','service')] + } class product_by_location(wizard.interface): - form1 = '''
+ + +