Browse Source

[ADD] Remove super cooperative from future planning

pull/65/head
nicolasjamoulle 6 years ago
parent
commit
120de0499f
  1. 17
      beesdoo_shift/models/task.py

17
beesdoo_shift/models/task.py

@ -81,12 +81,17 @@ 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 self.super_coop_id.id:
# to_unsubscribe_super_coop = self.search([('super_coop_id', 'in',
# self.super_coop_id.id)]
# + date_domain)
# to_unsubscribe_super_coop.write({'super_coop_id': False,
# 'is_regular': False})
# If worker is Super cooperative, remove it
super_coop_id = self.env['res.users'].search(
[('partner_id', '=', worker_ids[0]), ('super', '=', True)]).id
if super_coop_id:
to_unsubscribe_super_coop = self.search([('super_coop_id', '=',
super_coop_id),
('start_time', '>=',
today)])
to_unsubscribe_super_coop.write({'super_coop_id': False,
'is_regular': False})
@api.multi @api.multi
def write(self, vals): def write(self, vals):

Loading…
Cancel
Save