From 00b26faa5be53c264fc52bc06c2b698bd4e1df02 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Tue, 10 Dec 2019 15:50:38 +0100 Subject: [PATCH] Revert "[ADD] b_shift : attendance sheet default super cooperator" This reverts commit 605ac1853f6ab0497bb0a6bf566c66655056269d. --- beesdoo_shift/models/attendance_sheet.py | 27 ++++-------------------- beesdoo_shift/views/attendance_sheet.xml | 13 +++--------- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/beesdoo_shift/models/attendance_sheet.py b/beesdoo_shift/models/attendance_sheet.py index a092e30..e527940 100644 --- a/beesdoo_shift/models/attendance_sheet.py +++ b/beesdoo_shift/models/attendance_sheet.py @@ -165,14 +165,6 @@ class AttendanceSheet(models.Model): end_time = fields.Datetime(string="End Time", required=True, readonly=True) day = fields.Date(string="Day", compute="_compute_day", store=True) - default_super_coop_id = fields.Many2one( - "res.users", - string="Default Super Cooperative", - help="Super Cooperative for default Task Type", - domain=[("partner_id.super", "=", True)], - compute="_compute_default_super_coop_id", - store=True, - ) expected_shift_ids = fields.One2many( "beesdoo.shift.sheet.expected", "attendance_sheet_id", @@ -218,6 +210,7 @@ class AttendanceSheet(models.Model): string="Validated by", domain=[ ("eater", "=", "worker_eater"), + ("super", "=", True), ("working_mode", "=", "regular"), ("state", "not in", ("unsubscribed", "resigning")), ], @@ -266,23 +259,12 @@ class AttendanceSheet(models.Model): rec.day = fields.Date.from_string(rec.start_time) @api.depends("expected_shift_ids") - def _compute_default_super_coop_id(self): + def _compute_week(self): """ - Look for the super cooperator of a shift - with default Task Type + Compute Week Name from Planning Name of first expected shift """ for rec in self: - default_task_type = rec.env[ - "beesdoo.shift.sheet.expected" - ].default_task_type_id() - shift = rec.expected_shift_ids.search( - [ - ("task_type_id", "=", default_task_type.id), - ("super_coop_id", "!=", False), - ], - limit=1, - ) - rec.default_super_coop_id = shift.super_coop_id + rec.week = rec.expected_shift_ids.task_id.planning_id.name @api.depends("annotation") def _compute_is_annotated(self): @@ -407,7 +389,6 @@ class AttendanceSheet(models.Model): "worker_id": task.worker_id.id, "replacement_worker_id": task.replaced_id.id, "task_type_id": task.task_type_id.id, - "super_coop_id": task.super_coop_id.id, "stage": stage, "working_mode": task.working_mode, } diff --git a/beesdoo_shift/views/attendance_sheet.xml b/beesdoo_shift/views/attendance_sheet.xml index 89e21dd..b2d4a4d 100644 --- a/beesdoo_shift/views/attendance_sheet.xml +++ b/beesdoo_shift/views/attendance_sheet.xml @@ -8,7 +8,6 @@ - - Attendance Sheet List beesdoo.shift.sheet - - - + + + - @@ -164,9 +160,6 @@ - - -