From ab9f02cdee91d9caa873f190a40bbb17e6cbc7b4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 4 Mar 2015 09:37:19 +0100 Subject: [PATCH] [FIX] account_followup: overdue payments must exclude payments not yet due. Before this revision, the overdue payments report contained all payments due, including the ones in the future, that are not actually due yet. opw-628874 --- addons/account_followup/account_followup.py | 1 + addons/account_followup/report/account_followup_print.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 9cedbebf974..e7778cb76c2 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -315,6 +315,7 @@ class res_partner(osv.osv): ('reconcile_id', '=', False), ('state', '!=', 'draft'), ('company_id', '=', company_id), + ('date_maturity', '<=', fields.date.context_today(self,cr,uid)), ], context=context): raise osv.except_osv(_('Error!'),_("The partner does not have any accounting entries to print in the overdue report for the current company.")) self.message_post(cr, uid, [ids[0]], body=_('Printed overdue payments report'), context=context) diff --git a/addons/account_followup/report/account_followup_print.py b/addons/account_followup/report/account_followup_print.py index 25103498b4b..cd868629de5 100644 --- a/addons/account_followup/report/account_followup_print.py +++ b/addons/account_followup/report/account_followup_print.py @@ -21,6 +21,7 @@ import time from collections import defaultdict +from openerp.osv import fields from openerp import pooler from openerp.report import report_sxw @@ -57,6 +58,7 @@ class report_rappel(report_sxw.rml_parse): ('reconcile_id', '=', False), ('state', '!=', 'draft'), ('company_id', '=', company_id), + ('date_maturity', '<=', fields.date.context_today(self,self.cr,self.uid)), ]) # lines_per_currency = {currency: [line data, ...], ...}