Browse Source

Makeup on code after review

pull/65/head
nicolasjamoulle 6 years ago
parent
commit
d0df069801
  1. 11
      beesdoo_shift/models/task.py

11
beesdoo_shift/models/task.py

@ -82,14 +82,13 @@ class Task(models.Model):
to_unsubscribe_replace = self.search([('replaced_id', 'in', worker_ids)] + date_domain) to_unsubscribe_replace = self.search([('replaced_id', 'in', worker_ids)] + date_domain)
to_unsubscribe_replace.write({'worker_id': False, 'is_regular': False, 'replaced_id': False}) to_unsubscribe_replace.write({'worker_id': False, 'is_regular': False, 'replaced_id': False})
# If worker is Super cooperative, remove it from planning
super_coop_id = self.env['res.users'].search(
# If worker is Super cooperator, remove it from planning
super_coop_ids = self.env['res.users'].search(
[('partner_id', 'in', worker_ids), ('super', '=', True)]).ids [('partner_id', 'in', worker_ids), ('super', '=', True)]).ids
if super_coop_id:
to_unsubscribe_super_coop = self.search([('super_coop_id', 'in',
super_coop_id)] +
date_domain)
if super_coop_ids:
to_unsubscribe_super_coop = self.search(
[('super_coop_id', 'in', super_coop_ids)] + date_domain)
to_unsubscribe_super_coop.write({'super_coop_id': False, to_unsubscribe_super_coop.write({'super_coop_id': False,
'is_regular': False}) 'is_regular': False})

Loading…
Cancel
Save