Browse Source

[FIX] b_shift : computed methods not applying to recordset

pull/125/head
Elouan Le Bars 5 years ago
parent
commit
95b421af12
  1. 13
      beesdoo_shift/models/attendance_sheet.py

13
beesdoo_shift/models/attendance_sheet.py

@ -295,24 +295,25 @@ class AttendanceSheet(models.Model):
Look for the super cooperator of a shift
with default Task Type
"""
default_task_type = self.env[
for rec in self:
default_task_type = rec.env[
"beesdoo.shift.sheet.expected"
].default_task_type_id()
shift = self.expected_shift_ids.search(
shift = rec.expected_shift_ids.search(
[
("task_type_id", "=", default_task_type.id),
("super_coop_id", "!=", False),
],
limit=1,
)
self.default_super_coop_id = shift.super_coop_id
rec.default_super_coop_id = shift.super_coop_id
# Is this method necessary ?
@api.depends("annotation")
def _compute_is_annotated(self):
if self.annotation:
self.is_annotated = len(self.annotation) != 0
return
for rec in self:
if rec.annotation:
rec.is_annotated = len(rec.annotation) != 0
@api.model
def create(self, vals):

Loading…
Cancel
Save