From 0bdaa2d84fc2f60947c6e5803fdcbb273b3c0dc9 Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Mon, 20 Oct 2014 11:07:41 +0200 Subject: [PATCH] Propagate context + rework ternary if --- account_easy_reconcile/easy_reconcile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account_easy_reconcile/easy_reconcile.py b/account_easy_reconcile/easy_reconcile.py index ae1b9009..b3a14388 100644 --- a/account_easy_reconcile/easy_reconcile.py +++ b/account_easy_reconcile/easy_reconcile.py @@ -169,10 +169,9 @@ class AccountEasyReconcile(orm.Model): for reconcile_id in ids: last_history = history_obj.search( cr, uid, [('easy_reconcile_id', '=', reconcile_id)], - limit=1, order='date desc' + limit=1, order='date desc', context=context ) - result[reconcile_id] = len(last_history) \ - and last_history[0] or False + result[reconcile_id] = last_history[0] if last_history else False return result _columns = {