-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
[16.0[IMP]account_commission: add payment date limit on settle commissions #588
base: 16.0
Are you sure you want to change the base?
Conversation
Hi @pedrobaeza, |
ba276da
to
50f6a32
Compare
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
@@ -251,7 +251,30 @@ def _skip_settlement(self): | |||
:return: bool | |||
""" | |||
self.ensure_one() | |||
payment_based_commission = ( | |||
True if self.commission_id.invoice_state == "paid" else False |
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.
nitpick: this expression could be simplified
True if self.commission_id.invoice_state == "paid" else False | |
self.commission_id.invoice_state == "paid" |
50f6a32
to
8a9338b
Compare
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.
LGTM
context_date_payment = self.env.context.copy() | ||
context_date_payment["date_payment_to"] = self.date_payment_to | ||
self.env.context = context_date_payment |
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.
question: aren't these operations equivalent to
self.env.context["date_payment_to"] = self.date_payment_to
?
Or am I missing something?
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.
Hi @PicchiSeba, self.env.context is a frozendict, which is an immutable dictionary. Because of this, I couldn't add self.date_payment_to directly as you suggested.
Porting #441