From eacb6397b555dbd24a7cf68595ce8036d9bce191 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Fri, 10 Jan 2020 16:32:19 +0100 Subject: [PATCH] [FIX] b_shift : supercoop name not displayed on sheets --- beesdoo_shift/models/attendance_sheet.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/beesdoo_shift/models/attendance_sheet.py b/beesdoo_shift/models/attendance_sheet.py index 9c1e1d5..be17a68 100644 --- a/beesdoo_shift/models/attendance_sheet.py +++ b/beesdoo_shift/models/attendance_sheet.py @@ -11,7 +11,7 @@ from openerp.exceptions import UserError, ValidationError class AttendanceSheetShift(models.AbstractModel): _name = "beesdoo.shift.sheet.shift" _description = "Copy of an actual shift into an attendance sheet" - _order = 'task_type_id, worker_name' + _order = "task_type_id, worker_name" @api.model def default_task_type_id(self): @@ -50,11 +50,6 @@ class AttendanceSheetShift(models.AbstractModel): task_type_id = fields.Many2one( "beesdoo.shift.type", string="Task Type", default=default_task_type_id ) - super_coop_id = fields.Many2one( - "res.users", - string="Super Cooperative", - domain=[("partner_id.super", "=", True)], - ) working_mode = fields.Selection( related="worker_id.working_mode", string="Working Mode" ) @@ -64,7 +59,6 @@ class AttendanceSheetShift(models.AbstractModel): ) - class AttendanceSheetShiftExpected(models.Model): """ Already existing shifts on sheet creation. @@ -74,6 +68,9 @@ class AttendanceSheetShiftExpected(models.Model): _description = "Expected Shift" _inherit = ["beesdoo.shift.sheet.shift"] + super_coop_id = fields.Many2one( + related="task_id.super_coop_id", store=True + ) compensation_no = fields.Selection( [("0", "0"), ("1", "1"), ("2", "2"),], string="Compensations", )