Added dynamic tab title on product.

This commit is contained in:
Bertrand Chenal committed 2008-05-27 21:50:12 +02:00
1 parent 914801762d
commit 92934b1d2c
2 files changed
+11

No files matched your search

+1
View File
@@ -88,6 +88,7 @@
<field name="view_type">form</field>
<field name="domain">[('quantity', '!=', 0)]</field>
<field name="context">{'locations':active_ids}</field>
<field name="window_name" eval="False"/>
</record>
<record model="ir.action.keyword"
id="act_product_by_location_keyword1">
+10
View File
@@ -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()