Browse Source

Bug sur les dates local

12.0
Juliana 5 years ago
parent
commit
27bf1c9575
  1. BIN
      controllers/__pycache__/__init__.cpython-35.pyc
  2. BIN
      controllers/__pycache__/main.cpython-35.pyc
  3. BIN
      models/__pycache__/__init__.cpython-35.pyc
  4. BIN
      models/__pycache__/delivery.cpython-35.pyc
  5. BIN
      models/__pycache__/sale_order.cpython-35.pyc
  6. BIN
      models/__pycache__/vracoop_point_retrait.cpython-35.pyc
  7. BIN
      models/__pycache__/vracoop_retrait_suivi.cpython-35.pyc
  8. BIN
      models/__pycache__/vracoop_retrait_time.cpython-35.pyc
  9. 24
      models/vracoop_point_retrait.py
  10. 37
      models/vracoop_retrait_time.py
  11. 4
      static/src/scss/style.css
  12. 8
      views/vracoop_templates.xml

BIN
controllers/__pycache__/__init__.cpython-35.pyc

BIN
controllers/__pycache__/main.cpython-35.pyc

BIN
models/__pycache__/__init__.cpython-35.pyc

BIN
models/__pycache__/delivery.cpython-35.pyc

BIN
models/__pycache__/sale_order.cpython-35.pyc

BIN
models/__pycache__/vracoop_point_retrait.cpython-35.pyc

BIN
models/__pycache__/vracoop_retrait_suivi.cpython-35.pyc

BIN
models/__pycache__/vracoop_retrait_time.cpython-35.pyc

24
models/vracoop_point_retrait.py

@ -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))

37
models/vracoop_retrait_time.py

@ -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(

4
static/src/scss/style.css

@ -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);

8
views/vracoop_templates.xml

@ -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">

Loading…
Cancel
Save