@ -69,13 +69,13 @@ class VracoopPointRetrait(models.Model):
def slot_calculate ( self ) :
self . ensure_one ( )
LIST_WEEK_DAY = [
( ' lundi ' , 0 ) ,
( ' mardi ' , 1 ) ,
( ' mercredi ' , 2 ) ,
( ' jeudi ' , 3 ) ,
( ' vendredi ' , 4 ) ,
( ' samedi ' , 5 ) ,
( ' dimanche ' , 6 ) ,
( ' lundi ' , 0 , 1 , ' lun. ' ) ,
( ' mardi ' , 1 , 2 , ' mar. ' ) ,
( ' mercredi ' , 2 , 3 , ' mer. ' ) ,
( ' jeudi ' , 3 , 4 , ' jeu. ' ) ,
( ' vendredi ' , 4 , 5 , ' ven. ' ) ,
( ' samedi ' , 5 , 6 , ' sam. ' ) ,
( ' dimanche ' , 6 , 0 , ' dim. ' ) ,
]
for rec in self :
my_datetime = datetime . today ( )
@ -95,17 +95,17 @@ class VracoopPointRetrait(models.Model):
exclure_the_day = rec . vracoop_retrait_time_ids . search ( [
( ' vracoop_point_retrait_id ' , ' = ' , rec . id ) ,
( ' active_day ' , ' = ' , False ) ,
( ' name ' , ' = ' , week . strftime ( " % A " ) ) ] )
( ' name ' , ' = ' , week . strftime ( " % w " ) ) ] )
if exclure_the_day :
pass
else :
print ( " ----- week.strftime ----- " , str ( week . strftime ( " % A " ) ) )
corresponding_line = rec . vracoop_retrait_time_ids . search ( [
( ' vracoop_point_retrait_id ' , ' = ' , rec . id ) ,
( ' name ' , ' = ' , week . strftime ( " % A " ) ) ] )
( ' name ' , ' = ' , week . strftime ( " % w " ) ) ] )
for week_day in LIST_WEEK_DAY :
if week_day [ 0 ] == week . strftime ( " % A " ) :
if week_day [ 2 ] == int ( week . strftime ( " % w " ) ) :
byweekday = week_day [ 1 ]
day_short_name = week_day [ 3 ]
time_available_week = datetime (
week . year , week . month , week . day ) + timedelta (
hours = corresponding_line . availability_time )
@ -219,7 +219,7 @@ class VracoopPointRetrait(models.Model):
return_slot_list = slots
if return_slot_list :
vals . append (
( week . strftime ( " % a " ) ,
( day_short_name ,
week ,
week . strftime ( " % b " ) , return_slot_list ) )