diff options
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 0429c4d8..04dfbbc4 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -1,5 +1,5 @@ from odoo import models, api, fields, _ -from odoo.exceptions import UserError +from odoo.exceptions import UserError, ValidationError from datetime import date, datetime, timedelta # import datetime import logging @@ -361,6 +361,16 @@ class DownPayment(models.Model): rec.estimated_return_date = False rec.days_remaining = 0 + @api.onchange('date_back_to_office') + def _onchange_date_back_to_office(self): + if self.date_back_to_office and self.date_back_to_office < date.today(): + return { + 'warning': { + 'title': _('Tanggal Tidak Valid'), + 'message': _('Tanggal kembali ke kantor tidak boleh lebih awal dari hari ini.') + } + } + @api.onchange('applicant_name') def _onchange_applicant_name(self): if self.applicant_name: |
