diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-12 14:53:05 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-12 14:53:05 +0700 |
| commit | 1cb23337a20a27977da5e9a72e6face949d5642c (patch) | |
| tree | 9e6ee8421c11d28fdfde936b7fbf6682e0d57282 /indoteknik_custom/models/account_move.py | |
| parent | f9874dc8419c35737fb96b8aa8480f0d60e47e1d (diff) | |
Refactor due extension
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 0f021e6b..99439915 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -71,10 +71,9 @@ class AccountMove(models.Model): for invoice in self: invoice_day_to_due = 0 if invoice.payment_state not in ['paid', 'in_payment', 'reversed'] and invoice.invoice_date_due: + invoice_day_to_due = invoice.invoice_date_due - date.today() if invoice.new_due_date: invoice_day_to_due = invoice.new_due_date - date.today() - elif not invoice.new_due_date: - invoice_day_to_due = invoice.invoice_date_due - date.today() invoice_day_to_due = invoice_day_to_due.days invoice.invoice_day_to_due = invoice_day_to_due |
