Commit bb233916 by Etienne Freiss

Merge branch 'dev_cooperatic' into 2244-lock-paper-meal-voucher

parents 6b268f43 4183965e
......@@ -27,6 +27,9 @@ class ShiftRegistration(models.Model):
to_add = 2 if absence_status == 'absent' else 1
for s in self.env['shift.registration']\
.search([('id', 'in', self.ids)]):
# Missing a makeup leads to have an additional makeup (the shift you initialy missed + the makeup you missed)
if s.is_makeup is True:
to_add += 1
new_makeups_to_do = s.partner_id.makeups_to_do + to_add
s.partner_id.update({'makeups_to_do': new_makeups_to_do})
return super(ShiftRegistration, self).write(vals)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment