X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Faccount%2Fwizard%2Faccount_report_common.py;h=4438484aaaf7ab1d73b1ef0d7e3ec235c9d4be8e;hb=c74e6207016689ef28e857139f4157eeb04e57c1;hp=eea0650b6ff08b427a108082b01ef9135ca8d371;hpb=9824e0e19f6d4fa83d3d88db773eb35f2e31351e;p=odoo%2Fodoo.git diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index eea0650..4438484 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -119,11 +119,11 @@ class account_common_report(osv.osv_memory): def _get_fiscalyear(self, cr, uid, context=None): now = time.strftime('%Y-%m-%d') - company_id = None + company_id = False 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 ) + if ids: + company_id = self.browse(cr, uid, ids[0], context=context).company_id.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):