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
[8.0][IMP] Partial Payments #104
Conversation
fd156c0
to
9938445
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 👍
sale_commission/__openerp__.py
Outdated
@@ -31,7 +31,8 @@ | |||
"Daniel Campos <danielcampos@avanzosc.es>", | |||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>", | |||
"Oihane Crucelaegui <oihanecruce@gmail.com>", | |||
"Iván Todorovich <ivan.todorovich@gmail.com", | |||
"Iván Todorovich <ivan.todorovich@gmail.com" |
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.
Don't remove comma
@@ -172,8 +179,11 @@ class SettlementLine(models.Model): | |||
comodel_name="res.partner", readonly=True, related="agent_line.agent", | |||
store=True) | |||
settled_amount = fields.Float( | |||
related="agent_line.amount", readonly=True, store=True) | |||
string='Settled Amount', digits_compute=dp.get_precision('Account')) |
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 removing this related field?
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 @pedrobaeza, thank you for review, the reason is the related field has the total value to be paid to commission but now with partial payments this field can't be the same because here the value can be 30%, 50% etc depending the prorportional of what was paid in invoice
sale_commission/models/settlement.py
Outdated
@@ -14,7 +15,9 @@ class Settlement(models.Model): | |||
def _default_currency(self): | |||
return self.env.user.company_id.currency_id.id | |||
|
|||
total = fields.Float(compute="_compute_total", readonly=True, store=True) | |||
total = fields.Float( | |||
compute="_compute_total", 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.
A compute field is already readonly without inverse function.
sale_commission/models/settlement.py
Outdated
effective_date = fields.Date( | ||
string="Effective date", | ||
help="In case of commission type is based in Payments use this date" | ||
" in case of based in Invoice use invoice date.") |
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.
Add dots and commas to the redaction of the help.
b37dbf6
to
34aaf60
Compare
6264775
to
cfd5563
Compare
…ecision Account in fields Float, configure Report to use the right date depends on commission type and add Akretion as Contributors.
…the same line of commission.
…e same as in Settlement, proccess of Cancel Invoice and Settlement and unlink Settlement.
cfd5563
to
5fc4e82
Compare
5fc4e82
to
d6474b8
Compare
There are conflicting files and this is very old. I'm going to close it. If you still see this as needed, please fix the conflicts and open a new PR. |
In some cases of use the company make sells with Payment Terms like this two times in 07 and 28 days or three times in 30, 60, 90 days, the commission was paid or with Invoice created or after all Invoice is Paid, I included other option after the first Partial Payments we can create the Settlement with value based in the same percentage was paid. Example:
Total Invoice = 20000
Two Payments = 10000 after 7 days and 10000 after 28 days
Total Commission = 4000
After make the first payment
Total of Settlement need to be = 2000
And after second payment
Total of Settlement need to be = 2000