Browse Source

[REF] Redefining built-in 'id'

pull/142/head
robin.keunen 5 years ago
parent
commit
51e1ce6ed7
  1. 4
      beesdoo_shift_attendance/models/attendance_sheet.py
  2. 8
      beesdoo_shift_attendance/tests/test_beesdoo_shift.py

4
beesdoo_shift_attendance/models/attendance_sheet.py

@ -377,8 +377,8 @@ class AttendanceSheet(models.Model):
) )
# Expected shifts status update # Expected shifts status update
for id in self.expected_shift_ids.ids:
shift = self.env["beesdoo.shift.sheet.expected"].browse(id)
for id_ in self.expected_shift_ids.ids:
shift = self.env["beesdoo.shift.sheet.expected"].browse(id_)
if ( if (
shift.worker_id == worker and not shift.replaced_id shift.worker_id == worker and not shift.replaced_id
) or shift.replaced_id == worker: ) or shift.replaced_id == worker:

8
beesdoo_shift_attendance/tests/test_beesdoo_shift.py

@ -252,8 +252,8 @@ class TestBeesdooShift(TransactionCase):
sheet_1.on_barcode_scanned(barcode) sheet_1.on_barcode_scanned(barcode)
# Check expected shifts update # Check expected shifts update
for id in sheet_1.expected_shift_ids.ids:
shift = sheet_1.expected_shift_ids.browse(id)
for id_ in sheet_1.expected_shift_ids.ids:
shift = sheet_1.expected_shift_ids.browse(id_)
self.assertEqual(shift.state, "done") self.assertEqual(shift.state, "done")
""" """
@ -275,8 +275,8 @@ class TestBeesdooShift(TransactionCase):
self.assertEqual(len(sheet_1.added_shift_ids), 2) self.assertEqual(len(sheet_1.added_shift_ids), 2)
# Check added shifts fields # Check added shifts fields
for id in sheet_1.added_shift_ids.ids:
shift = sheet_1.added_shift_ids.browse(id)
for id_ in sheet_1.added_shift_ids.ids:
shift = sheet_1.added_shift_ids.browse(id_)
self.assertEqual(sheet_1, shift.attendance_sheet_id) self.assertEqual(sheet_1, shift.attendance_sheet_id)
self.assertEqual(shift.state, "done") self.assertEqual(shift.state, "done")
self.assertEqual( self.assertEqual(

Loading…
Cancel
Save