From d2ca6c789d061fcbc2a72196077cb4226b5ecee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Thu, 23 May 2019 17:02:32 +0200 Subject: [PATCH] Revert "[FIX] b_shift: Too late shift validation" This reverts commit 351a107a65094b413da6fdc034274a2fee076eb1. This commit try to fix with a naive approach that doesn't work in every case. A better fix must be done in the future. --- beesdoo_shift/__openerp__.py | 2 +- beesdoo_shift/models/task.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/beesdoo_shift/__openerp__.py b/beesdoo_shift/__openerp__.py index baa4ec3..7ff8d95 100644 --- a/beesdoo_shift/__openerp__.py +++ b/beesdoo_shift/__openerp__.py @@ -13,7 +13,7 @@ 'website': "https://github.com/beescoop/Obeesdoo", 'category': 'Cooperative management', - 'version': '9.0.1.0.1', + 'version': '0.1', 'depends': ['beesdoo_base'], diff --git a/beesdoo_shift/models/task.py b/beesdoo_shift/models/task.py index 097cadd..5ce5175 100644 --- a/beesdoo_shift/models/task.py +++ b/beesdoo_shift/models/task.py @@ -203,16 +203,8 @@ class Task(models.Model): elif self.worker_id.working_mode == 'irregular': status = self.worker_id.cooperative_status_ids[0] - alert_start_time = fields.Date.from_string( - self.worker_id.cooperative_status_ids[0].alert_start_time - ) - start_time = fields.Date.from_string(self.start_time) - sr = self.worker_id.cooperative_status_ids[0].sr if new_stage == DONE or new_stage == NECESSITY: - if start_time <= alert_start_time and sr >= -2: - data['sr'] = 2 - else: - data['sr'] = 1 + data['sr'] = 1 data['irregular_absence_date'] = False data['irregular_absence_counter'] = 1 if status.irregular_absence_counter < 0 else 0 if new_stage == ABSENT or new_stage == EXCUSED: