Browse Source

[FIX] website_shift: Past shifts not ordered desc

The past shift was not properly ordered. This fix by ordering the past
shifts from the newest to the oldest.
pull/33/head
Rémy Taymans 6 years ago
parent
commit
96bb9830a8
  1. 4
      beesdoo_website_shift/controllers/main.py

4
beesdoo_website_shift/controllers/main.py

@ -328,14 +328,14 @@ class WebsiteShiftController(http.Controller):
past_shifts = request.env['beesdoo.shift.shift'].sudo().search(
[('start_time', '<=', now.strftime("%Y-%m-%d %H:%M:%S")),
('worker_id', '=', cur_user.partner_id.id)],
order="start_time, task_template_id, task_type_id",
order="start_time desc, task_template_id, task_type_id",
limit=past_shift_limit,
)
else:
past_shifts = request.env['beesdoo.shift.shift'].sudo().search(
[('start_time', '<=', now.strftime("%Y-%m-%d %H:%M:%S")),
('worker_id', '=', cur_user.partner_id.id)],
order="start_time, task_template_id, task_type_id",
order="start_time desc, task_template_id, task_type_id",
)
return {

Loading…
Cancel
Save