Commit 1f68d0ab by François C.

Modification condition attribution statut delay

parent 8b3bd9fb
...@@ -76,19 +76,6 @@ class ResPartner(models.Model): ...@@ -76,19 +76,6 @@ class ResPartner(models.Model):
@api.multi @api.multi
def get_makeups_choosen_shifts(self):
for partner in self:
cond = [
['partner_id', '=', partner.id],
['shift_type', '=', 'standard'],
['is_makeup', '=', True],
['date_begin', '>=', datetime.datetime.now().isoformat()],
['state', '=', 'open']
]
fields = ['id']
return self.env['shift.registration'].search_read(cond, fields)
@api.multi
def _compute_lacagette_working_state(self): def _compute_lacagette_working_state(self):
_logger.debug("Dans _compute_lacagette_working_state") _logger.debug("Dans _compute_lacagette_working_state")
conf = self.env['ir.config_parameter'] conf = self.env['ir.config_parameter']
...@@ -128,7 +115,7 @@ class ResPartner(models.Model): ...@@ -128,7 +115,7 @@ class ResPartner(models.Model):
self.env['shift.counter.event'].unsubscribe_partner(partner, unsubscribe_limit, points) self.env['shift.counter.event'].unsubscribe_partner(partner, unsubscribe_limit, points)
else: else:
if partner.date_alert_stop: if partner.date_alert_stop:
if partner.date_delay_stop and partner.date_delay_stop > current_datetime: if partner.makeups_to_do == 0 and partner.date_delay_stop and partner.date_delay_stop > current_datetime:
state = 'delay' state = 'delay'
else: else:
state = 'suspended' state = 'suspended'
......
...@@ -181,8 +181,6 @@ class ShiftCounterEvent(models.Model): ...@@ -181,8 +181,6 @@ class ShiftCounterEvent(models.Model):
if partner.makeups_to_do == 0: if partner.makeups_to_do == 0:
target_status = 'up_to_date' target_status = 'up_to_date'
else: else:
already_choosen_makeups_to_do = partner.get_makeups_choosen_shifts()
_logger.info("already_choosen_makeups_to_do : %s", str(already_choosen_makeups_to_do))
target_status = 'delay' target_status = 'delay'
if target_status is not None: if target_status is not None:
vals_for_update = {'working_state': target_status, 'cooperative_state': target_status} vals_for_update = {'working_state': target_status, 'cooperative_state': target_status}
......
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