Commit 61251cd1 by Yvon

prevent saving negative value for makeups_to_do in db

parent 3f1b6284
Pipeline #3371 failed with stage
in 1 minute 6 seconds
......@@ -959,7 +959,12 @@ class CagetteMember(models.Model):
api = OdooAPI()
res = {}
f = { 'makeups_to_do': int(member_data["target_makeups_nb"]) }
# Prevent setting a negative number of makeups_to_do
# https://redmine.coopdev.fr/issues/6090
# This could happen when bdm has two screens open and clicks on minus btn on a coop line
# with exactly 1 makeup_to_do on both screens
makeups_to_do = max(0,int(member_data["target_makeups_nb"]))
f = { 'makeups_to_do': makeups_to_do }
res_item = api.update('res.partner', [self.id], f)
res = {
'mid': self.id,
......
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