Skip to content
Snippets Groups Projects
Unverified Commit deef119d authored by Kinner Vachhani's avatar Kinner Vachhani Committed by Martin Trigaux
Browse files

[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
parent ff38b370
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment