From 45c5a07d89bc3b0319c57e1069ac26ea97f59257 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 6 Mar 2018 16:53:46 +0100 Subject: [PATCH] [FIX] account: allow to include zero amount lines in aged partner balance Make an invoice Make a payment Unreconcile them Before this commit: The invoice and the payment weren't display in the aged partner balance After this commit: Both payment and invoice *can* be included in the balance OPW 1819359 --- addons/account/report/account_aged_partner_balance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 0128c6c8b35..ededb3a7db9 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -13,6 +13,10 @@ class ReportAgedPartnerBalance(models.AbstractModel): _name = 'report.account.report_agedpartnerbalance' def _get_partner_move_lines(self, account_type, date_from, target_move, period_length): + # This method can receive the context key 'include_nullified_amount' {Boolean} + # Do an invoice and a payment and unreconcile. The amount will be nullified + # By default, the partner wouldn't appear in this report. + # The context key allow it to appear periods = {} start = datetime.strptime(date_from, "%Y-%m-%d") for i in range(5)[::-1]: @@ -190,7 +194,7 @@ class ReportAgedPartnerBalance(models.AbstractModel): values['name'] = _('Unknown Partner') values['trust'] = False - if at_least_one_amount: + if at_least_one_amount or self._context.get('include_nullified_amount'): res.append(values) return res, total, lines