summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/account_move.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 126ff4c3..fd9ed758 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -21,3 +21,14 @@ class AccountMove(models.Model):
add_days += line.days
due_date = tukar_date + timedelta(days=add_days)
invoice.invoice_date_due = due_date
+
+ @api.onchange('date_terima_tukar_faktur')
+ def change_date_terima_tukar_faktur(self):
+ for invoice in self:
+ tukar_date = invoice.date_terima_tukar_faktur
+ term = invoice.invoice_payment_term_id
+ add_days = 0
+ for line in term.line_ids:
+ add_days += line.days
+ due_date = tukar_date + timedelta(days=add_days)
+ invoice.invoice_date_due = due_date