diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-08-18 09:27:16 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-08-18 09:27:16 +0700 |
| commit | e7c4b8161fde799cba05f371018315776539b479 (patch) | |
| tree | c366043e8e1a701d0fe719f0eba3f5e289225988 | |
| parent | 90fb71ebdd4f7324a5491780f24dc18b8bd7ccc4 (diff) | |
(andri) sisa hari pengajuan tidak dihitung lagi jika status approved dan reject
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index e0828968..9c200cca 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -499,10 +499,13 @@ class DownPayment(models.Model): } - @api.depends('date_back_to_office') + @api.depends('date_back_to_office', 'status') def _compute_days_remaining(self): today = date.today() for rec in self: + if rec.status in ['approved', 'reject'] and rec.days_remaining: + continue + if rec.date_back_to_office: due_date = rec.date_back_to_office + timedelta(days=7) rec.estimated_return_date = due_date |
