From deef119d725de620a0bcaf3d5b0e028ab2a577b9 Mon Sep 17 00:00:00 2001 From: Kinner Vachhani Date: Fri, 29 Jan 2016 15:36:51 +0000 Subject: [PATCH] [FIX] account: substitution in aged partner report 'foo %s bar' % 'alice' if False else 'bob' returns 'bob', not 'foo bob bar' The previous strings returns '>=' when the direction is future while it should be 'COALESCE(l.date_maturity,l.date) >= %s' Fixes #10654 Closes #10695 --- addons/account/report/account_aged_partner_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 3ed137f0a88..b7bc1c32586 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -190,7 +190,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): partial = date and date[0][0] <= form[str(i)]['stop'] if partial: # partial reconcilation - limit_date = 'COALESCE(l.date_maturity,l.date) %s %%s' % '<=' if self.direction_selection == 'past' else '>=' + limit_date = 'COALESCE(l.date_maturity,l.date) %s %%s' % ('<=' if self.direction_selection == 'past' else '>=',) self.cr.execute('''SELECT SUM(l.debit-l.credit) FROM account_move_line AS l, account_move AS am WHERE l.move_id = am.id AND am.state in %s