diff --git a/controllers/__pycache__/__init__.cpython-35.pyc b/controllers/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..7c169b8 Binary files /dev/null and b/controllers/__pycache__/__init__.cpython-35.pyc differ diff --git a/controllers/__pycache__/main.cpython-35.pyc b/controllers/__pycache__/main.cpython-35.pyc new file mode 100644 index 0000000..4ff2daf Binary files /dev/null and b/controllers/__pycache__/main.cpython-35.pyc differ diff --git a/models/__pycache__/__init__.cpython-35.pyc b/models/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..d2d86b0 Binary files /dev/null and b/models/__pycache__/__init__.cpython-35.pyc differ diff --git a/models/__pycache__/delivery.cpython-35.pyc b/models/__pycache__/delivery.cpython-35.pyc new file mode 100644 index 0000000..2d10ddd Binary files /dev/null and b/models/__pycache__/delivery.cpython-35.pyc differ diff --git a/models/__pycache__/sale_order.cpython-35.pyc b/models/__pycache__/sale_order.cpython-35.pyc new file mode 100644 index 0000000..b955cd2 Binary files /dev/null and b/models/__pycache__/sale_order.cpython-35.pyc differ diff --git a/models/__pycache__/vracoop_point_retrait.cpython-35.pyc b/models/__pycache__/vracoop_point_retrait.cpython-35.pyc new file mode 100644 index 0000000..b5d9600 Binary files /dev/null and b/models/__pycache__/vracoop_point_retrait.cpython-35.pyc differ diff --git a/models/__pycache__/vracoop_retrait_suivi.cpython-35.pyc b/models/__pycache__/vracoop_retrait_suivi.cpython-35.pyc new file mode 100644 index 0000000..8c8ed7e Binary files /dev/null and b/models/__pycache__/vracoop_retrait_suivi.cpython-35.pyc differ diff --git a/models/__pycache__/vracoop_retrait_time.cpython-35.pyc b/models/__pycache__/vracoop_retrait_time.cpython-35.pyc new file mode 100644 index 0000000..bba3850 Binary files /dev/null and b/models/__pycache__/vracoop_retrait_time.cpython-35.pyc differ diff --git a/models/vracoop_point_retrait.py b/models/vracoop_point_retrait.py index 678d848..cc3c802 100644 --- a/models/vracoop_point_retrait.py +++ b/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)) diff --git a/models/vracoop_retrait_time.py b/models/vracoop_retrait_time.py index d8e2a2f..60ed373 100644 --- a/models/vracoop_retrait_time.py +++ b/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( diff --git a/static/src/scss/style.css b/static/src/scss/style.css index 5409d6f..9b29d02 100644 --- a/static/src/scss/style.css +++ b/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); diff --git a/views/vracoop_templates.xml b/views/vracoop_templates.xml index fa1f6bb..a3be104 100644 --- a/views/vracoop_templates.xml +++ b/views/vracoop_templates.xml @@ -7,6 +7,14 @@