From 92934b1d2cdaa8c2d2ee544752b96e4bd75584a3 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 27 May 2008 21:50:12 +0200 Subject: [PATCH] Added dynamic tab title on product. --- location.xml | 1 + product.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/location.xml b/location.xml index 862485df1c..655de82327 100644 --- a/location.xml +++ b/location.xml @@ -88,6 +88,7 @@ form [('quantity', '!=', 0)] {'locations':active_ids} + diff --git a/product.py b/product.py index 95a809ad74..98ccb0cf79 100644 --- a/product.py +++ b/product.py @@ -126,4 +126,14 @@ class Product(OSV): 'uom': key[2], 'quantity': val} for key, val in res.iteritems()] + def view_header_get(self, cursor, user, value, view_type='form', + context=None): + if not context.get('locations'): + return False + location_obj = self.pool.get('stock.location') + locations = location_obj.browse(cursor, user, context.get('locations'), + context=context) + return "Products by location (" + \ + ",".join([l.name for l in locations]) + ")" + Product()