Tryton - Issues

 

Issue8828

Title Infinite warning loop when tryton to pay a receivable line
Priority bug Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type behavior Components account_payment
Assigned To pokoli Keywords review
Reviews 258401003
View: 258401003

Created on 2019-11-15.18:39:17 by pokoli, last changed by roundup-bot.

Messages
New changeset 1ef5805602f3 by Sergi Almacellas Abellana in branch '5.4':
Make GroupedLines warning unique per selected lines
https://hg.tryton.org/modules/account_payment/rev/1ef5805602f3

New changeset 0943eec8186d by Sergi Almacellas Abellana in branch '5.2':
Make GroupedLines warning unique per selected lines
https://hg.tryton.org/modules/account_payment/rev/0943eec8186d
New changeset 1bb981c38206 by Sergi Almacellas Abellana in branch 'default':
Make GroupedLines warning unique per selected lines
https://hg.tryton.org/tryton-env/rev/1bb981c38206
New changeset 2825998aecbb by Sergi Almacellas Abellana in branch 'default':
Make GroupedLines warning unique per selected lines
https://hg.tryton.org/modules/account_payment/rev/2825998aecbb
review258401003 updated at https://codereview.tryton.org/258401003/#ps272671002
review258401003 updated at https://codereview.tryton.org/258401003/#ps280461002
review258401003 updated at https://codereview.tryton.org/258401003/#ps262481002
review258401003 updated at https://codereview.tryton.org/258401003/#ps282441002
review258401003 updated at https://codereview.tryton.org/258401003/#ps286301002
msg53261 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-11-16.15:14:15
OK so the warning names should be made unique. Probably using the same hash technique as in issue8800.
msg53260 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-11-16.15:10:30
Because the warning is deleted and recreated on the next iteration of the loop as warning_name is the same for all lines.
msg53236 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-11-15.23:04:40
I do not see how the loop can be infinite. The warning name seems to be unique on each iteration.
review258401003 updated at https://codereview.tryton.org/258401003/#ps254641002
msg53227 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-11-15.18:39:17
When a party has more than one reverse move a warning is raised multiple times and you can not ignore it. I've managed to reproduce the issue on a fresh database with the following Lines to Pay fore the same party:

Amount  	Currency    Move
"100,00"	"Euro"	    "3"	
"-40,00"	"Euro"	    "2"	
"-50,00"	"Euro"	    "1"	

The issue is reproducible when trying to pay the receivable from the "Financial -> Payments -> Lines To Pay" menu option. The problem is that the warning is checked inside a line loop [1], so when the loop has more than one result the Warning.check is recreated on the next iteration which causes to re-raise it despite it has been already accepted. 

I've found the issue on 5.2 series. Older series are not affected.

[1]  https://hg.tryton.org/modules/account_payment/file/bfbaeac712e0/account.py#l262
History
Date User Action Args
2020-01-22 22:24:31roundup-botsetmessages: + msg54999
keyword: - backport
2020-01-07 10:15:00roundup-botsetmessages: + msg54749
2020-01-07 10:14:50roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg54748
2019-12-18 13:08:22cedsetkeyword: + backport
2019-12-18 10:03:39reviewbotsetmessages: + msg54570
2019-11-21 10:13:10reviewbotsetmessages: + msg53375
2019-11-20 23:43:51reviewbotsetmessages: + msg53367
2019-11-20 09:48:08cedsettitle: Infinite warning loop when tryton to pay a recevaible line -> Infinite warning loop when tryton to pay a receivable line
2019-11-20 09:33:57reviewbotsetmessages: + msg53346
2019-11-18 12:08:17reviewbotsetmessages: + msg53298

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