Added default value for company field on move

This commit is contained in:
Bertrand Chenal committed 2008-05-22 02:02:50 +02:00
1 parent 63a19ab1c1
commit f7d9dabbdd
1 file changed
+7
+7
View File
@@ -86,6 +86,13 @@ class Move(OSV):
]
self._order[0] = ('id', 'DESC')
def default_company(self, cursor, user, context=None):
if context.get('company'):
return context.get('company')
user_obj = self.pool.get('res.user')
user = user_obj.browse(cursor, user, user, context=context)
return user.company.id
def default_to_location(self, cursor, user, context=None):
if context and context.get('warehouse') and context.get('type'):
wh_location = self.pool.get('stock.location').browse(