Handle default value in context for ir.sequence

This commit is contained in:
Cédric Krier committed 2008-11-25 12:39:32 +01:00
1 parent b74c857161
commit 014f4c729c
1 file changed
+9
+9
View File
@@ -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()