[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
This commit is contained in:
Lucas Perais (lpe)
2018-03-09 09:07:33 +01:00
parent 303f547690
commit 45c5a07d89
@@ -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