diff --git a/account.py b/account.py index 3b1c8f450a..751beaa20f 100644 --- a/account.py +++ b/account.py @@ -251,9 +251,13 @@ class Account(OSV): return True def default_company(self, cursor, user, context=None): + company_obj = self.pool.get('company.company') if context is None: context = {} - return context.get('company', False) + if context.get('company'): + return company_obj.name_get(cursor, user, context['company'], + context=context)[0] + return False def default_type(self, cursor, user, context=None): type_obj = self.pool.get('account.account.type') diff --git a/tax.py b/tax.py index 4091283e6d..c465d84c46 100644 --- a/tax.py +++ b/tax.py @@ -313,9 +313,13 @@ class Tax(OSV): return 1 def default_company(self, cursor, user, context=None): + company_obj = self.pool.get('company.company') if context is None: context = {} - return context.get('company', False) + if context.get('company'): + return company_obj.name_get(cursor, user, context['company'], + context=context)[0] + return False def _process_tax(self, cursor, user, tax, price_unit, context=None): if tax.type == 'percentage':