Tryton - Issues

 

Issue8828

Title Infinite warning loop when tryton to pay a receivable line
Priority bug Status testing
Superseder Nosy List ced, pokoli, reviewbot
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 reviewbot.

Messages
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
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
2019-11-16 15:14:16cedsetmessages: + msg53261
2019-11-16 15:10:30pokolisetmessages: + msg53260
2019-11-15 23:04:41cedsetnosy: + ced
messages: + msg53236
2019-11-15 19:04:11reviewbotsetnosy: + reviewbot
messages: + msg53232
2019-11-15 18:41:04pokolisettitle: Infinite warning loop when tryton to pay a recevaible loop -> Infinite warning loop when tryton to pay a recevaible line

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