Skip to content
Extraits de code Groupes Projets
Valider 27bf1c95 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

Bug sur les dates local

parent 2ca6d903
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de avec 45 ajouts et 28 suppressions
Fichier ajouté
Fichier ajouté
Fichier ajouté
Fichier ajouté
Fichier ajouté
Fichier ajouté
Fichier ajouté
Fichier ajouté
......@@ -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))
......
......@@ -10,14 +10,23 @@ class VracoopRetraitTime(models.Model):
vracoop_time_id = fields.Many2one('vracoop.time', 'Conf time')
name = fields.Selection([
('lundi', 'Lundi'),
('mardi', 'Mardi'),
('mercredi', 'Mercredi'),
('jeudi', 'Jeudi'),
('vendredi', 'Vendredi'),
('samedi', 'Samedi'),
('dimanche', 'Dimanche')],
(1, 'Lundi'),
(2, 'Mardi'),
(3, 'Mercredi'),
(4, 'Jeudi'),
(5, 'Vendredi'),
(6, 'Samedi'),
(0, 'Dimanche')],
string='Jour de la semaine')
# name = fields.Selection([
# ('lundi', 'Lundi'),
# ('mardi', 'Mardi'),
# ('mercredi', 'Mercredi'),
# ('jeudi', 'Jeudi'),
# ('vendredi', 'Vendredi'),
# ('samedi', 'Samedi'),
# ('dimanche', 'Dimanche')],
# string='Jour de la semaine')
first_morning_heure = fields.Float(string='Heure du 1er retrait (matin)')
last_morning_heure = fields.Float(
string='Heure du dernier retrait (matin)')
......@@ -37,13 +46,13 @@ class VracoopTime(models.Model):
_description = "Configuration horaires de base"
name = fields.Selection([
('lundi', 'Lundi'),
('mardi', 'Mardi'),
('mercredi', 'Mercredi'),
('jeudi', 'Jeudi'),
('vendredi', 'Vendredi'),
('samedi', 'Samedi'),
('dimanche', 'Dimanche')],
(1, 'Lundi'),
(2, 'Mardi'),
(3, 'Mercredi'),
(4, 'Jeudi'),
(5, 'Vendredi'),
(6, 'Samedi'),
(0, 'Dimanche')],
string='Jour de la semaine')
first_morning_heure = fields.Float(string='Heure du 1er retrait (matin)')
last_morning_heure = fields.Float(
......
......@@ -183,9 +183,9 @@
border-bottom: 0px solid #dee2e6;
}
#retrait_method h5, #retrait_method span{
/*#retrait_method h5, #retrait_method span{
margin: 0.5rem;
}
}*/
.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(0, 160, 157, 0);
......
......@@ -7,6 +7,14 @@
<input t-att-value="point_retrait.id" t-att-id="'point_retrait2_%i' % point_retrait.id" type="radio" name="point_retrait_type" t-att-checked="order.vracoop_point_retrait_id and order.vracoop_point_retrait_id.id == point_retrait.id and 'checked' or False" t-att-class="'d-none' if point_retrait_nb == 1 else ''"/>
</a>
<label class="label-optional" t-field="point_retrait.name" t-att-for="'point_retrait2_%i' % point_retrait.id"/>
<t t-if="point_retrait.street">
<br/><span><t t-esc="point_retrait.street"/></span><br/>
</t>
<t t-if="point_retrait.street2">
<span><t t-esc="point_retrait.street2"/></span><br/>
</t>
<span><t t-esc="point_retrait.city"/>
<t t-esc="point_retrait.zip"/></span><br/><br/>
<div class="collapse" data-parent="#retrait_method" t-att-id="'slots_point_retrait_%i' % point_retrait.id">
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter