From 014f4c729c3a4d89036fbeebe103784e4fc5f2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Nov 2008 12:39:32 +0100 Subject: [PATCH] Handle default value in context for ir.sequence --- company.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/company.py b/company.py index 40a20ca6d3..eb732659e7 100644 --- a/company.py +++ b/company.py @@ -157,6 +157,15 @@ class Sequence(OSV): super(Sequence, self).__init__() self._order.insert(0, ('company', 'ASC')) + def default_company(self, cursor, user, context=None): + company_obj = self.pool.get('company.company') + if context is None: + context = {} + if context.get('company'): + return company_obj.name_get(cursor, user, context['company'], + context=context)[0] + return False + Sequence()