Tryton - Issues



Title Take lines without maturity date as line to pay
Priority bug Status resolved
Superseder Nosy List albertcuni, ced, reviewbot, risto3, roundup-bot
Type behavior Components account_invoice
Assigned To albertcuni Keywords easy, review
Reviews 268521003
View: 268521003

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

New changeset 775266cbfbe4 by C├ędric Krier in branch 'default':
Take lines without maturity date as payable
New changeset 5238020365b2 by Albert Cunillera Benet in branch 'default':
Take lines without maturity date as payable
review268521003 updated at
review268521003 updated at
review268521003 updated at
review268521003 updated at
review268521003 updated at
msg53333 (view) Author: [hidden] (risto3) Date: 2019-11-19.15:10:44
I believe I'm having some issues with this.
That is, now I'm see bunches of payments from the bank journals in the payable/receivable lines form instead of only the real payable/receivable lines.

Perhaps there's more glue or rather a hammer needed?
In any event, for the few cases where it comes up, it would probably be better to edit the maturity_date.

I'm going to revert the patch below.
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-12-12 13:02:41roundup-botsetmessages: + msg54466
2019-12-12 13:02:37roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg54465
2019-12-02 12:37:34reviewbotsetmessages: + msg53787
2019-11-28 19:10:12reviewbotsetmessages: + msg53724
2019-11-26 23:20:28reviewbotsetmessages: + msg53687
2019-11-26 10:14:26reviewbotsetmessages: + msg53651
2019-11-25 09:41:31reviewbotsetnosy: + reviewbot
messages: + msg53472
2019-11-22 11:32:04albertcunisetreviews: 268521003
2019-11-22 11:31:04albertcunisetstatus: in-progress -> testing
reviews: In progress -> (no value)
2019-11-22 11:18:18albertcunisetreviews: In progress
keyword: + review

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