From 64fb2659b6a3c32f11e96a63da3b2e6f4803a555 Mon Sep 17 00:00:00 2001 From: mikevhe18 Date: Tue, 7 Jan 2025 15:56:30 +0700 Subject: [PATCH] [ssi_hr_overtime] Task #T/01/25/000028 --- ssi_hr_overtime/models/hr_overtime.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ssi_hr_overtime/models/hr_overtime.py b/ssi_hr_overtime/models/hr_overtime.py index 0db3631..1103221 100644 --- a/ssi_hr_overtime/models/hr_overtime.py +++ b/ssi_hr_overtime/models/hr_overtime.py @@ -122,7 +122,7 @@ def _compute_sheet(self): date = fields.Date( string="Date", required=True, - default=fields.Date.today(), + default=lambda self: fields.Date.today(), readonly=True, states={ "draft": [ @@ -133,6 +133,7 @@ def _compute_sheet(self): date_start = fields.Datetime( required=True, readonly=True, + default=lambda self: fields.Datetime.now(), states={ "draft": [ ("readonly", False), @@ -142,6 +143,7 @@ def _compute_sheet(self): date_end = fields.Datetime( required=True, readonly=True, + default=lambda self: fields.Datetime.now(), states={ "draft": [ ("readonly", False), @@ -335,6 +337,7 @@ def _check_limit(self): ("state", "not in", ["cancel", "reject"]), ("id", "!=", self.id), ("date", "=", self.date), + ("type_id", "=", self.type_id.id), ] overtime_ids = self.search(criteria) total_ot = 0.0