-
-
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
[15.0][IMP] commission: multi-currency support #405
Conversation
Hi @pedrobaeza, |
7198cbb
to
e3fe100
Compare
@alexeirivera87 Thanks for this. This deserves some tests. Could you add them ? |
ef2d6ac
to
7091a50
Compare
7091a50
to
fd902ce
Compare
@rousseldenis Thanks. I added some tests. Let me know if it is correct now. Regards |
Hello Any news on this PR ? regards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and function test: LGTM
@@ -199,6 +199,7 @@ class AccountInvoiceLineAgent(models.Model): | |||
currency_id = fields.Many2one( | |||
related="object_id.currency_id", | |||
readonly=True, | |||
store=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be fatal on module upgrade, needing to store it for all the existing lines. Why do you need this?
@@ -78,15 +78,20 @@ def action_invoice(self): | |||
def _get_invoice_partner(self): | |||
return self[0].agent_id | |||
|
|||
def _get_invoice_currency(self): | |||
return self[0].currency_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this method needed?
@@ -14,16 +14,19 @@ class CommissionMakeSettle(models.TransientModel): | |||
ondelete={"sale_invoice": "cascade"}, | |||
) | |||
|
|||
def _get_account_settle_domain(self, agent, date_to_agent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outside the scope of the PR. I'm not against it. Just that is should be done apart.
("state", "=", "settled"), | ||
("settlement_type", "=", self.settlement_type), | ||
], | ||
limit=1, | ||
) | ||
|
||
def _prepare_settlement_vals(self, agent, company, sett_from, sett_to): | ||
def _prepare_settlement_vals(self, agent, company, currency, sett_from, sett_to): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing a signature in a stable version is not correct, as it will convert in incompatible all the existing overwrites of this method. Don't you have any other way?
Hello @alexeirivera87 |
Superseded by #446 |
Hello
Could someone please check these changes ?
regards