From 75692bc988eb7f6b33ddd7c6c9f960fda2c26746 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Thu, 5 Jan 2017 10:25:39 +0100 Subject: [PATCH] Update account_report_common.py (#14891) [FIX] account: fixed onchange_chart_id that was failing on last and first day of the year. Courtesy of Noviat --- addons/account/wizard/account_report_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 6641c280765..1d4f24d4124 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -35,7 +35,7 @@ class account_common_report(osv.osv_memory): if chart_account_id: company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id now = time.strftime('%Y-%m-%d') - domain = [('company_id', '=', company_id), ('date_start', '<', now), ('date_stop', '>', now)] + domain = [('company_id', '=', company_id), ('date_start', '<=', now), ('date_stop', '>=', now)] fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1) res['value'] = {'company_id': company_id, 'fiscalyear_id': fiscalyears and fiscalyears[0] or False} return res @@ -131,7 +131,7 @@ class account_common_report(osv.osv_memory): company_id = self.pool.get('account.account').browse(cr, uid, ids[0], context=context).company_id.id else: # use current company id company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id - domain = [('company_id', '=', company_id), ('date_start', '<', now), ('date_stop', '>', now)] + domain = [('company_id', '=', company_id), ('date_start', '<=', now), ('date_stop', '>=', now)] fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1) return fiscalyears and fiscalyears[0] or False