Commit 2258452b by Yvon

fix bug : should not go below -2 points in this situation where we are actually adding points

parent cad73f7c
......@@ -30,7 +30,10 @@ class ShiftCounterEvent(models.Model):
makeups_total_count = p['makeups_to_do'] + len(res_shift_reg)
if points_after_required_change + makeups_total_count > 0:
points_target = - makeups_total_count
if points_target < -2:
points_target = -2
vals['point_qty'] = points_target - p.final_standard_point
except Exception as e:
# don't block process if an error occurs here
_logger.error("Error during _alter_point_event_depending_on_makeups_total_count : %s", str(e))
......
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