Skip to content

Commit

Permalink
[FIX] sale_commission_check_deposit: do not filter non deposited checks
Browse files Browse the repository at this point in the history
  • Loading branch information
renda-dev committed Jul 17, 2024
1 parent d4382aa commit 713210a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion sale_commission_check_deposit/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ class AccountJournal(models.Model):
_inherit = "account.journal"

is_check_journal = fields.Boolean()
safety_days = fields.Integer(default=5)
safety_days = fields.Integer(
string="Safety days for commission",
help="Days after expiration date for commission settlement",
default=5,
)
5 changes: 2 additions & 3 deletions sale_commission_check_deposit/wizard/wizard_check_settle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import json
from datetime import date, timedelta
from datetime import timedelta

from odoo import models

Expand Down Expand Up @@ -31,13 +31,12 @@ def get_move_ids(self, payments_widget):
[
("move_id", "in", account_move_ids),
("journal_id.is_check_journal", "=", True),
("check_deposit_id", "!=", False),
]
)
return all(
[
x.date_maturity + timedelta(days=x.journal_id.safety_days)
< date.today()
< self.date_payment_to
for x in move_lines
]
)

0 comments on commit 713210a

Please sign in to comment.