Tryton - Issues



Title Take lines without maturity date as line to pay
Priority bug Status chatting
Superseder Nosy List ced, risto3
Type behavior Components account_invoice
Assigned To Keywords easy

Created on 2019-11-03.16:53:27 by ced, last changed by ced.

msg53130 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-11-11.01:59:01
Then please do not submit patch.
msg53129 (view) Author: [hidden] (risto3) Date: 2019-11-10.22:56:27
no way, still requires g$$gle
msg53127 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-11-10.21:39:25
Please follow:
msg53125 (view) Author: [hidden] (risto3) Date: 2019-11-10.18:41:19
This seems okay too:

diff -r dce2c10d0a43
--- a/        Sun Nov 10 17:55:10 2019 +0100
+++ b/        Sun Nov 10 18:35:47 2019 +0100
@@ -4,7 +4,7 @@
 from collections import defaultdict, namedtuple
 from itertools import combinations
-from sql import Null
+from sql import Null, NullsLast
 from sql.aggregate import Sum
 from sql.conditionals import Coalesce, Case
 from sql.functions import Round
@@ -659,8 +659,8 @@
                 condition=((invoice.move == line.move)
                     & (invoice.account == line.account))).select(
-                        where=(line.maturity_date != Null) & red_sql,
-                        order_by=(, line.maturity_date)))
+                        where=red_sql,
+                        order_by=(, NullsLast(line.maturity_date))))
             for invoice_id, line_id in cursor.fetchall():
         return lines
msg53017 (view) Author: [hidden] (risto3) Date: 2019-11-03.18:42:54
indeed, I quickly tried removing '(line.maturity_date != Null)' 

that allows process() to work correctly with pertinent lines having null maturity_date, but I ignore if anything else needs checking.
msg53013 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-11-03.16:53:26
In rev 4a726694e1db, I added such constraint. The commit message is not clear but I think it was to prevent comparison in Python between date instance and None.
Now we use SQL for that so such constraint is useless (but we should order null last).
Date User Action Args
2019-11-11 01:59:01cedsetmessages: + msg53130
2019-11-10 22:56:27risto3setmessages: + msg53129
2019-11-10 21:39:25cedsetmessages: + msg53127
2019-11-10 18:41:20risto3setmessages: + msg53125
2019-11-03 18:42:55risto3setstatus: unread -> chatting
nosy: + risto3
messages: + msg53017
2019-11-03 16:53:27cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)