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

[15.0][IMP] commission: multi-currency support #405

Closed
wants to merge 1 commit into from

Conversation

alexeirivera87
Copy link
Contributor

Hello

Could someone please check these changes ?

regards

@OCA-git-bot
Copy link
Contributor

Hi @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@alexeirivera87 alexeirivera87 force-pushed the 15.0-imp-commission branch 2 times, most recently from 7198cbb to e3fe100 Compare March 15, 2023 22:43
@rousseldenis rousseldenis added this to the 15.0 milestone Mar 16, 2023
@rousseldenis
Copy link

@alexeirivera87 Thanks for this. This deserves some tests. Could you add them ?

@alexeirivera87 alexeirivera87 force-pushed the 15.0-imp-commission branch 2 times, most recently from ef2d6ac to 7091a50 Compare March 18, 2023 20:20
@alexeirivera87
Copy link
Contributor Author

@rousseldenis Thanks. I added some tests. Let me know if it is correct now. Regards

@alexeirivera87
Copy link
Contributor Author

Hello

Any news on this PR ?

@rousseldenis

@pedrobaeza

regards

@alexeirivera87
Copy link
Contributor Author

@ernestotejeda

Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 left a 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,
Copy link
Member

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
Copy link
Member

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):
Copy link
Member

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):
Copy link
Member

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?

@jguenat
Copy link
Member

jguenat commented Jun 13, 2023

Hello @alexeirivera87
Do you have time to finish this PR? Otherwise I could continue.
Thanks

@pedrobaeza
Copy link
Member

Superseded by #446

@pedrobaeza pedrobaeza closed this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants