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))