From 680e6889b1fc967fcf4ab0402cbe7c33acb09813 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 30 Mar 2015 21:13:30 +0200 Subject: [PATCH] [FIX] account: Partner Ledger wizard didn't consider all filters and type of entries: The report generated by this wizard considered all the partners without taking into account the filters and target entries set. To show the right partner the function _set_context must consider the "self.query" which sets the period, the dates, the states, the accounts and the journals of the sql query used to give the demanded partner. opw:631649 --- addons/account/report/account_partner_ledger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 8c1c6d83cc3..4d2c10c8ccd 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -96,6 +96,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): if (data['model'] == 'res.partner') and ids: PARTNER_REQUEST = "AND l.partner_id IN %s" params += [tuple(ids)] + reconcile = "" if self.reconcil else "AND l.reconcile_id IS NULL " self.cr.execute( "SELECT DISTINCT l.partner_id " \ "FROM account_move_line AS l, account_account AS account, " \ @@ -104,10 +105,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): "AND l.account_id = account.id " \ "AND am.id = l.move_id " \ "AND am.state IN %s" -# "AND " + self.query +" " \ + "AND " + self.query +" " \ "AND l.account_id IN %s " \ " " + PARTNER_REQUEST + " " \ - "AND account.active ", params) + "AND account.active " + reconcile + " ", params) self.partner_ids = [res['partner_id'] for res in self.cr.dictfetchall()] objects = obj_partner.browse(self.cr, SUPERUSER_ID, self.partner_ids) objects.sort(key=lambda x: (x.ref, x.name))