From bf9fabc98de0ec5e5422e9b722069e4dac58ec6c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 9 Apr 2009 15:32:19 +0200 Subject: [PATCH] [FIX] report_account: avoid a crash at init when the fiscal year can't be found bzr revid: christophe@tinyerp.com-20090409133219-1cvken23kk88adnu --- addons/report_account/report_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_account/report_receivable.py b/addons/report_account/report_receivable.py index ce17b84f2e4..61fb577a3f4 100644 --- a/addons/report_account/report_receivable.py +++ b/addons/report_account/report_receivable.py @@ -126,7 +126,7 @@ class report_aged_receivable(osv.osv): pool_obj_fy = pooler.get_pool(cr.dbname).get('account.fiscalyear') today = mx.DateTime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') - mx.DateTime.RelativeDateTime(days=1) today = today.strftime('%Y-%m-%d') - fy_id = pool_obj_fy.find(cr,uid) + fy_id = pool_obj_fy.find(cr,uid, exception=False) LIST_RANGES = [] if fy_id: fy_start_date = pool_obj_fy.read(cr, uid, fy_id, ['date_start'])['date_start']