Skip to content
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

Merged
merged 1 commit into from
Jan 29, 2016

Conversation

pedrobaeza
Copy link
Member

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.

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.
@pedrobaeza pedrobaeza force-pushed the 8.0-sale_commission-refund_fix branch from 83ebfda to fc37236 Compare January 26, 2016 02:38
@pedrobaeza
Copy link
Member Author

@ivantodorovich @oihane, please check this one.

@oihane
Copy link
Contributor

oihane commented Jan 26, 2016

Is it correct to do twice super?

@pedrobaeza
Copy link
Member Author

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).

@oihane
Copy link
Contributor

oihane commented Jan 27, 2016

After a quick test 👍

@pedrobaeza
Copy link
Member Author

@ivantodorovich, can I get another positive review? Or @Daniel-CA, can you review this one?

@ivantodorovich
Copy link
Contributor

@pedrobaeza shouldn't it also be inverting the commission line amount? to be consistent with #56

otherwise 👍 just tested it

@pedrobaeza
Copy link
Member Author

It's not needed, as the negative amounts are obtained on the computed field, so the fields we pass are correct.

@oihane
Copy link
Contributor

oihane commented Jan 28, 2016

I did a quick test in runbot

  • Customer invoice:
    image
  • Customer refund invoice:
    image

@ivantodorovich does this solve your doubt?

@Daniel-CA
Copy link

That's fine for me. 👍

pedrobaeza added a commit that referenced this pull request Jan 29, 2016
[FIX] sale_commission: Refunds from invoices. Fixes #51
@pedrobaeza pedrobaeza merged commit 18bbfaa into OCA:8.0 Jan 29, 2016
@pedrobaeza pedrobaeza deleted the 8.0-sale_commission-refund_fix branch January 29, 2016 08:17
@ivantodorovich
Copy link
Contributor

@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.

@ivantodorovich
Copy link
Contributor

I stand corrected. It works perfectly! Sorry 😳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants