From 8f357dbcc8fe142f72f4ff108c58d2eee12919f0 Mon Sep 17 00:00:00 2001 From: Chris Forbes <> Date: Fri, 9 Nov 2012 18:13:09 +0530 Subject: [PATCH] [FIX]account:fixed the issue Aged Partner Balance Report chooses FY for wrong company lp bug: https://launchpad.net/bugs/1018591 fixed bzr revid: ssu@tinyerp.com-20121109124309-zxritll4gzbr7jv8 --- addons/account/wizard/account_report_common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 9acc09e9026..eea0650b6ff 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -119,7 +119,11 @@ class account_common_report(osv.osv_memory): def _get_fiscalyear(self, cr, uid, context=None): now = time.strftime('%Y-%m-%d') - fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 ) + company_id = None + ids = context.get('active_ids', []) + for wiz in self.browse(cr, uid, ids, context=context): + company_id = wiz.company_id + fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1 ) return fiscalyears and fiscalyears[0] or False def _get_all_journal(self, cr, uid, context=None):