Skip to content

Commit

Permalink
[17.0][FIX] sale_commission
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 committed Jan 27, 2025
1 parent 1180162 commit 46fd5ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ addon | version | maintainers | summary | price
[deltatech_sale](deltatech_sale/) | 17.0.1.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Sale Extension Obsolete | Free
[deltatech_sale_activity_search](deltatech_sale_activity_search/) | 17.0.0.0.0 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Adds a field with the active activity types on that sale order | Free
[deltatech_sale_add_extra_line](deltatech_sale_add_extra_line/) | 17.0.1.0.9 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Sale Add Extra Line | Free
[deltatech_sale_commission](deltatech_sale_commission/) | 17.0.1.2.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Compute sale commission | Free
[deltatech_sale_commission](deltatech_sale_commission/) | 17.0.1.2.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Compute sale commission | Free
[deltatech_sale_contact](deltatech_sale_contact/) | 17.0.1.0.21 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Limit contacts insale order | Free
[deltatech_sale_cost_product](deltatech_sale_cost_product/) | 17.0.0.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Sale Cost on Order | Free
[deltatech_sale_feedback](deltatech_sale_feedback/) | 17.0.1.0.5 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Sale Feedback | Free
Expand Down
2 changes: 1 addition & 1 deletion deltatech_sale_commission/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Sale Commission",
"summary": "Compute sale commission",
"version": "17.0.1.2.0",
"version": "17.0.1.2.1",
"category": "Sales",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
Expand Down
2 changes: 1 addition & 1 deletion deltatech_sale_commission/models/commission_condition.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from odoo import fields, models


class SaleMarginReport(models.Model):
class SaleCommissionCondition(models.Model):
_name = "sale.commission.condition"
_description = "Commission condition"

Expand Down
6 changes: 3 additions & 3 deletions deltatech_sale_commission/wizard/commission_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def do_compute(self):
# if the invoice is paid, we will calculate the commission based on the payment date
if line.invoice_id.payment_state == "paid":
# take the latest payment date
last_payment = sorted(line.invoice_id.invoice_payments_widget["content"], key=lambda d: d["date"])[
0
]
last_payment = sorted(
line.invoice_id.invoice_payments_widget["content"], key=lambda d: d["date"], reverse=True
)[0]
days_difference = (
fields.Date.to_date(last_payment["date"]) - line.invoice_id.invoice_date
).days # calculate the days difference between the invoice date and the payment date
Expand Down

0 comments on commit 46fd5ca

Please sign in to comment.