From 3625e6b425c7ddce3934ddb95719fbaec75d8300 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Tue, 26 Nov 2024 09:09:53 +0100 Subject: [PATCH] [FIX] shopfloor: fix sort move line in case of reception, move line can be added without a move, the sort should consider this case and take move line create date instead of move_id date --- shopfloor/actions/move_line_search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shopfloor/actions/move_line_search.py b/shopfloor/actions/move_line_search.py index a608652ccd..18cdf128bd 100644 --- a/shopfloor/actions/move_line_search.py +++ b/shopfloor/actions/move_line_search.py @@ -161,7 +161,7 @@ def _sort_key_move_lines_priority(self, line): # make prority negative to keep sorting ascending return self._sort_key_assigned_to_current_user(line) + ( -int(line.move_id.priority or "0"), - line.move_id.date, + line.move_id.date if line.move_id else line.create_date, line.move_id.id, ) @@ -169,7 +169,7 @@ def _sort_key_move_lines_location(self, line): return self._sort_key_assigned_to_current_user(line) + ( line.location_id.shopfloor_picking_sequence or "", line.location_id.name, - line.move_id.date, + line.move_id.date if line.move_id else line.create_date, line.move_id.id, )