Issue 9729

Title
Domain error when posting a statement with cancelled invoices
Priority
feature
Status
resolved
Nosy list
acaubet, ced, pokoli, reviewbot, roundup-bot
Assigned to
acaubet
Keywords
easy, review

Created on 2020-10-16.16:52:04 by pokoli, last changed 2 months ago by roundup-bot.

Messages

New changeset a58a39360324 by Cédric Krier in branch 'default':
Warn user when posting a statement with canceled or paid lines
https://hg.tryton.org/tryton-env/rev/a58a39360324
New changeset 90cc8fdb0fd2 by Adrià Tarroja Caubet in branch 'default':
Warn user when posting a statement with canceled or paid lines
https://hg.tryton.org/modules/account_statement/rev/90cc8fdb0fd2
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-10-16.17:45:22
On 2020-10-16 17:28, Sergi Almacellas Abellana wrote:
> I proposed to clear the invoice because we already clear posted invoices: 
> 
> https://hg.tryton.org/modules/account_statement/file/1021ec9c9953/statement.py#l521
> 
> So I'm wondering if we should also warn the user when cancelling a posted invoice that is contained in a draft statement. 
> 
> What do you think?

Indeed having the same behavior as for paid invoice will be good as it
warns the user and he will decide.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-10-16.17:28:20
For me the problem is that it warns that there is an invoice which is not valid, but does not explain the error nor which invoice is wrong.

When there are a lot of lines (for example our case had 675 statement lines) it's  very hard to find the invoice and fix it. 

So if you want to keep the error, we should replace it by an UserError which gives more details. 

I proposed to clear the invoice because we already clear posted invoices: 

https://hg.tryton.org/modules/account_statement/file/1021ec9c9953/statement.py#l521

So I'm wondering if we should also warn the user when cancelling a posted invoice that is contained in a draft statement. 

What do you think?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-10-16.17:03:30
I do not agree. For me, the behavior is correct as it warns the user that the statement is no more postable.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-10-16.16:52:04
Steps to reproduce:

1. Createa a supplier invoice and post it
2. Create an statement with a line to pay the supplier invoice
3. Cancel the invoice
4. Try to post the statement

A domain validation error is raised because the invoice is cancelled before posting. 

I think the invoice should be cleared from statement line when cancelling.
History
Date User Action Args
2021-02-12 20:21:55roundup-botsetmessages: + msg64504
2021-02-12 20:21:50roundup-botsetmessages: + msg64503
nosy: + roundup-bot
status: testing -> resolved
2021-02-05 09:29:47reviewbotsetmessages: + msg64321
2021-01-22 10:11:30reviewbotsetmessages: + msg64034
2021-01-07 09:16:57reviewbotsetmessages: + msg63795
2021-01-04 10:25:32reviewbotsetmessages: + msg63751
2021-01-04 09:56:03reviewbotsetmessages: + msg63750
2020-11-30 16:00:26reviewbotsetmessages: + msg62316
2020-11-17 17:55:11reviewbotsetmessages: + msg61994
2020-11-02 09:14:30reviewbotsetmessages: + msg61582

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