From bd5367bd66fc100ac830320693dbced9ba5c9555 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 9 Sep 2020 10:38:15 +0200 Subject: [PATCH] inventory: always fetch tray The check was means as an optimization: no need to fetch at tray already open. But "fetch_tray" will not only open the tray, it may also move the laser on the exact position. So we should do it for every inventory line. --- .../models/vertical_lift_operation_inventory.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stock_vertical_lift/models/vertical_lift_operation_inventory.py b/stock_vertical_lift/models/vertical_lift_operation_inventory.py index 93805a4a19ba..c0372494b58c 100644 --- a/stock_vertical_lift/models/vertical_lift_operation_inventory.py +++ b/stock_vertical_lift/models/vertical_lift_operation_inventory.py @@ -232,17 +232,13 @@ def fetch_tray(self): def select_next_inventory_line(self): self.ensure_one() - previous_line = self.current_inventory_line_id next_line = self.env["stock.inventory.line"].search( self._domain_inventory_lines_to_do(), limit=1, order="vertical_lift_tray_id, location_id, id", ) self.current_inventory_line_id = next_line - if ( - next_line - and previous_line.vertical_lift_tray_id != next_line.vertical_lift_tray_id - ): + if next_line: self.fetch_tray() return bool(next_line)