-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] sale_commission: Refunds from invoices. Fixes #51 #53
Conversation
When creating a refund from an invoice, pass correct values (converted as dictionary) for the agents lines, so that the refund keep the same commissions (but reversed) than the original invoice.
83ebfda
to
fc37236
Compare
@ivantodorovich @oihane, please check this one. |
Is it correct to do twice |
We are not making super with the same argument. Take into account that this method serves as a cleaning method. We need to clean the data in the one2many field also. Odoo already calls this method several times (for the invoice line and for the tax lines). |
After a quick test 👍 |
@ivantodorovich, can I get another positive review? Or @Daniel-CA, can you review this one? |
@pedrobaeza shouldn't it also be inverting the commission line amount? to be consistent with #56 otherwise 👍 just tested it |
It's not needed, as the negative amounts are obtained on the computed field, so the fields we pass are correct. |
I did a quick test in runbot @ivantodorovich does this solve your doubt? |
That's fine for me. 👍 |
[FIX] sale_commission: Refunds from invoices. Fixes #51
@oihane actually, no. Even if it's showing a negative commission on the invoice total, it's only negative there, the agent line's commission is still possitive. So, when you make that settlement, you will be paying 600 $ to your agent. (300+300) instead of 0 (300-300) But I'll see how it works with #56 and continue the work there if needed, since it's within its scope. I'm away for a few days that's why I didn't make much progress. |
I stand corrected. It works perfectly! Sorry 😳 |
When creating a refund from an invoice, pass correct values
(converted as dictionary) for the agents lines, so that the refund
keep the same commissions (but reversed) than the original invoice.