changeset 5238020365b2 in modules/account_invoice:default
details:
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=5238020365b2
description:
Take lines without maturity date as payable
issue8788
review268521003
diffstat:
CHANGELOG | 2 ++
invoice.py | 7 ++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r 72c07eb1b780 -r 5238020365b2 CHANGELOG
--- a/CHANGELOG Wed Dec 11 18:40:23 2019 +0100
+++ b/CHANGELOG Thu Dec 12 12:49:37 2019 +0100
@@ -1,3 +1,5 @@
+* Take lines without maturity date as payable
+
Version 5.4.0 - 2019-11-04
* Bug fixes (see mercurial logs for details)
* Prevent using same sequence on earlier customer invoice
diff -r 72c07eb1b780 -r 5238020365b2 invoice.py
--- a/invoice.py Wed Dec 11 18:40:23 2019 +0100
+++ b/invoice.py Thu Dec 12 12:49:37 2019 +0100
@@ -659,8 +659,8 @@
condition=((invoice.move == line.move)
& (invoice.account == line.account))).select(
invoice.id, line.id,
- where=(line.maturity_date != Null) & red_sql,
- order_by=(invoice.id, line.maturity_date)))
+ where=red_sql,
+ order_by=(invoice.id, line.maturity_date.nulls_last)))
for invoice_id, line_id in cursor.fetchall():
lines[invoice_id].append(line_id)
return lines
@@ -693,7 +693,8 @@
if line.reconciliation:
continue
if (name == 'amount_to_pay_today'
- and line.maturity_date > today):
+ and (not line.maturity_date
+ or line.maturity_date > today)):
continue
if (line.second_currency
and line.second_currency == invoice.currency):