Skip to content

Commit

Permalink
inventory: always fetch tray
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guewen committed Sep 9, 2020
1 parent 6358aec commit bd5367b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bd5367b

Please sign in to comment.