Browse Source
Merge pull request #71 from nicolasj77/keep_worker_name_on_shift
[FIX] beesdoo_shift remove only next shifts in planning for unsubscri…
pull/72/head
Nicolas Jamoulle
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
6 deletions
-
beesdoo_shift/models/cooperative_status.py
|
@ -222,9 +222,11 @@ class CooperativeStatus(models.Model): |
|
|
data['alert_start_time'] = False |
|
|
data['alert_start_time'] = False |
|
|
self.write(data) |
|
|
self.write(data) |
|
|
if new_state == 'unsubscribed' or new_state == 'resigning': |
|
|
if new_state == 'unsubscribed' or new_state == 'resigning': |
|
|
self.cooperator_id.sudo().write({'subscribed_shift_ids' : [(5,0,0)]}) |
|
|
|
|
|
#TODO: Add one day othertwise unsubscribed from the shift you were absent |
|
|
|
|
|
self.env['beesdoo.shift.shift'].sudo().unsubscribe_from_today([self.cooperator_id.id], today=self.today) |
|
|
|
|
|
|
|
|
self.cooperator_id.sudo().write( |
|
|
|
|
|
{'subscribed_shift_ids': [(5, 0, 0)]}) |
|
|
|
|
|
# TODO: Add one day otherwise unsubscribed from the shift you were absent |
|
|
|
|
|
self.env['beesdoo.shift.shift'].sudo().unsubscribe_from_today( |
|
|
|
|
|
[self.cooperator_id.id], today=fields.Date.today()) |
|
|
|
|
|
|
|
|
def _change_counter(self, data): |
|
|
def _change_counter(self, data): |
|
|
self.sc += data.get('sc', 0) |
|
|
self.sc += data.get('sc', 0) |
|
|