From fa738cbc3f7d35b427db9bb062cb774762b8faf8 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 3 Jun 2008 15:27:37 +0200 Subject: [PATCH] Added dynamic view title when employee is in context. --- line.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/line.py b/line.py index 1e8dfb64b6..04f16be4e9 100644 --- a/line.py +++ b/line.py @@ -50,6 +50,15 @@ class Line(OSV): return context['date'] return datetime.date.today() + def view_header_get(self, cursor, user, value, view_type='form', + context=None): + if not context.get('employee'): + return False + employee_obj = self.pool.get('company.employee') + employee = employee_obj.browse(cursor, user, context['employee'], + context=context) + return value + " (" + employee.name + ")" + Line()