From 6d3f3605fe5cd8dd7846efd6426973a35e935a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Thu, 20 Oct 2022 09:44:24 +0200 Subject: [PATCH] Exclude active record from type search issue11729 review435911044 --- attendance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/attendance.py b/attendance.py index e137b68547..1ca7cb66d8 100644 --- a/attendance.py +++ b/attendance.py @@ -137,11 +137,12 @@ class Line(ModelSQL, ModelView): attendance=record.rec_name, period=period_date)) - @fields.depends('employee', 'at') + @fields.depends('employee', 'at', 'id') def on_change_with_type(self): records = self.search([ ('employee', '=', self.employee), ('at', '<', self.at), + ('id', '!=', self.id), ], order=[('at', 'desc')], limit=1)