summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/down_payment.py5
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