Issue 10845

Title
Removed commissions when create a credit invoice throw wizard
Priority
bug
Status
testing
Nosy list
bernatnan, ced, reviewbot
Assigned to
bernatnan
Keywords
review

Created on 2021-10-11.12:29:55 by bernatnan, last changed yesterday by reviewbot.

Messages

Author: [hidden] (bernatnan)
Date: 2021-10-11.14:39:47
>
> OK I understand now.
>

Perfect :-)

> This is since rev 22eabf722a91.

Correct.

> So I guess the best solution is that commission module does not delete nor
> reverse the existing commission if the canceled invoice is posted.

I agree. For me will be the best way, because the only way to cancel a
posted invoice is with the "Cancel" wizard.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-10-11.13:32:35

OK I understand now.
This is since rev 22eabf722a91. So I guess the best solution is that commission module does not delete nor reverse the existing commission if the canceled invoice is posted.

Author: [hidden] (bernatnan)
Date: 2021-10-11.13:20:16
>
> > If you create the credit invoice throw the wizard and set it to
> > 'with_refund', Tryton will leave the commission inconsistent, so create
> new
> > credit commissions when create the credit invoice, but in the "original"
> > invoice or remove the existent commissions or create a cancel commissions
> > twice.
>
> I do not understand this sentence. It seems missing some subjects.
>

Sorry, I rewrite the sentence:

If you create a credit invoice launching the 'Credit' wizard setting
'with_refund' to True, Tryton will leave the commissions inconsistent. It
will happen because the new credit invoice creates new credit commissions,
but at the same time the "original" invoice will remove the existing
commissions or will create a cancel commissions. And in both cases will
leave the commissions in an incorrect state because the credit commissions
created by the credit invoice are without its counterpart.

I don't know if I have explained better?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-10-11.12:57:19
On 2021-10-11 12:50, Bernat Brunet wrote:
> If you create the credit invoice throw the wizard and set it to
> 'with_refund', Tryton will leave the commission inconsistent, so create new
> credit commissions when create the credit invoice, but in the "original"
> invoice or remove the existent commissions or create a cancel commissions
> twice.

I do not understand this sentence. It seems missing some subjects.
Author: [hidden] (bernatnan)
Date: 2021-10-11.12:50:30
>
> I do not understand. What are you calling "commissions"?
>

The fields 'commissions' in the 'account.invoice.line' model.

On one side we have in the commission module, in the invoice.py file; there
is the 'def cancel' function of the invoice model. There, the commissions
associated with an invoice/invoice_line are removed if not setted the
'from_commissions' field or created the the cancel commissions if the
'from_commissions' is set.

And on the other in the same model, there is the 'def _credit' function
that sets the agent of the new credit invoice, so this will create the new
credit commissions when the credit invoice will be posted.

If you create the credit invoice throw the wizard and set it to
'with_refund', Tryton will leave the commission inconsistent, so create new
credit commissions when create the credit invoice, but in the "original"
invoice or remove the existent commissions or create a cancel commissions
twice.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-10-11.12:32:00

I do not understand. What are you calling "commissions"?

Author: [hidden] (bernatnan)
Date: 2021-10-11.12:29:55

When create a credit invoice throw wizard the commissions of the invoice are remove and it's not correct, so the credit invoice created create new negative commissions. We need to maintain the original commissions or not create the new ones and remove the original.

History
Date User Action Args
2021-10-18 12:11:38reviewbotsetmessages: + msg71072
2021-10-16 17:11:04reviewbotsetmessages: + msg71036
2021-10-15 19:25:35cedsetassignedto: bernatnan
status: chatting -> testing
2021-10-12 23:09:38reviewbotsetmessages: + msg70976
nosy: + reviewbot
status: unread -> chatting
2021-10-12 22:38:23bernatnansetkeyword: + review
reviews: 387121002
status: chatting -> unread
2021-10-11 14:39:47bernatnansetmessages: + msg70863
2021-10-11 13:32:35cedsetmessages: + msg70862
status: need-eg -> chatting
2021-10-11 13:20:16bernatnansetmessages: + msg70859
2021-10-11 12:57:19cedsetmessages: + msg70858
2021-10-11 12:50:30bernatnansetmessages: + msg70857

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