[FIX] account: fixed bad default values for chart of accounts/taxes in reporting wizards
bzr revid: qdp-launchpad@openerp.com-20120416081256-kzznkz5rtibwa0fy
This commit is contained in:
parent
876f092244
commit
77847d4b21
|
@ -110,7 +110,8 @@ class account_common_report(osv.osv_memory):
|
|||
return res
|
||||
|
||||
def _get_account(self, cr, uid, context=None):
|
||||
accounts = self.pool.get('account.account').search(cr, uid, [('parent_id', '=', False)], limit=1)
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
accounts = self.pool.get('account.account').search(cr, uid, [('parent_id', '=', False), ('company_id', '=', user.company_id.id)], limit=1)
|
||||
return accounts and accounts[0] or False
|
||||
|
||||
def _get_fiscalyear(self, cr, uid, context=None):
|
||||
|
|
|
@ -34,7 +34,8 @@ class account_vat_declaration(osv.osv_memory):
|
|||
}
|
||||
|
||||
def _get_tax(self, cr, uid, context=None):
|
||||
taxes = self.pool.get('account.tax.code').search(cr, uid, [('parent_id', '=', False)], limit=1)
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
taxes = self.pool.get('account.tax.code').search(cr, uid, [('parent_id', '=', False), ('company_id', '=', user.company_id.id)], limit=1)
|
||||
return taxes and taxes[0] or False
|
||||
|
||||
_defaults = {
|
||||
|
|
Loading…
Reference in New Issue