Commit 659ede3e by Yvon

rename method

parent 02b48dfc
Pipeline #3189 failed with stage
in 1 minute 6 seconds
...@@ -1290,7 +1290,7 @@ class CagetteMembers(models.Model): ...@@ -1290,7 +1290,7 @@ class CagetteMembers(models.Model):
# 2 : providing makeups to come to all members # 2 : providing makeups to come to all members
cs = CagetteShift() cs = CagetteShift()
makeups_to_come_per_partner = cs.get_count_of_makeups_to_come_per_partner() makeups_to_come_per_partner = cs.get_partners_with_makeups_to_come()
# 1 : fetching members with no makeups to do but with some makeups to come # 1 : fetching members with no makeups to do but with some makeups to come
cond = [['makeups_to_do', '=', 0], ['id', 'in', list(makeups_to_come_per_partner.keys())]] cond = [['makeups_to_do', '=', 0], ['id', 'in', list(makeups_to_come_per_partner.keys())]]
......
...@@ -185,7 +185,7 @@ class CagetteShift(models.Model): ...@@ -185,7 +185,7 @@ class CagetteShift(models.Model):
shiftData = self.o_api.search_read('shift.registration', cond, fields, order ="date_begin ASC") shiftData = self.o_api.search_read('shift.registration', cond, fields, order ="date_begin ASC")
return shiftData return shiftData
def get_count_of_makeups_to_come_per_partner(self): def get_partners_with_makeups_to_come(self):
"""Returns a dictionary with : keys = the partners ids having at least one makeup to come ; values = #makeups_to_come""" """Returns a dictionary with : keys = the partners ids having at least one makeup to come ; values = #makeups_to_come"""
fields = ['partner_id'] fields = ['partner_id']
cond = [['state', '=', 'open'], ['date_begin', '>', datetime.datetime.now().isoformat()], ['is_makeup', '=', True]] cond = [['state', '=', 'open'], ['date_begin', '>', datetime.datetime.now().isoformat()], ['is_makeup', '=', True]]
......
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