From 836bac417a30e6638dd851ca811ff76c52f17184 Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Fri, 22 May 2026 10:01:59 +0200 Subject: [PATCH] [FIX] shopfloor_reception: fix scan lot domain from v18, see https://github.com/OCA/stock-logistics-shopfloor/pull/109 --- shopfloor_reception/services/reception.py | 4 +-- .../tests/test_select_document.py | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/shopfloor_reception/services/reception.py b/shopfloor_reception/services/reception.py index 1792d9ffc4..a8f97dc657 100644 --- a/shopfloor_reception/services/reception.py +++ b/shopfloor_reception/services/reception.py @@ -158,8 +158,8 @@ def _domain_move_line_by_lot(self, lot): ("move_id.picking_id.state", "=", "assigned"), ("move_id.picking_id.user_id", "=", False), "|", - ("lot_id.name", "=", lot), - ("lot_name", "=", lot), + ("lot_id", "=", lot.id), + ("lot_name", "=", lot.name), ] def _domain_stock_picking(self, today_only=False): diff --git a/shopfloor_reception/tests/test_select_document.py b/shopfloor_reception/tests/test_select_document.py index d9a2aadb66..614e630abe 100644 --- a/shopfloor_reception/tests/test_select_document.py +++ b/shopfloor_reception/tests/test_select_document.py @@ -198,3 +198,35 @@ def test_scan_packaging_no_picking(self): data={"pickings": self._data_for_pickings(picking)}, message=message, ) + + def test_scan_lot_1(self): + picking = self._create_picking() + lot = self._create_lot() + line_product_a = picking.move_ids.move_line_ids.filtered( + lambda line: line.product_id == self.product_a + ) + line_product_a.lot_id = lot + response = self.service.dispatch("scan_document", params={"barcode": lot.name}) + body = "Several transfers found, please select a transfer manually." + self.assert_response( + response, + next_state="select_document", + data={"pickings": self._data_for_pickings(picking)}, + message={"message_type": "error", "body": body}, + ) + + def test_scan_lot_2(self): + picking = self._create_picking() + lot = self._create_lot() + line_product_a = picking.move_ids.move_line_ids.filtered( + lambda line: line.product_id == self.product_a + ) + line_product_a.lot_name = lot.name + response = self.service.dispatch("scan_document", params={"barcode": lot.name}) + body = "Several transfers found, please select a transfer manually." + self.assert_response( + response, + next_state="select_document", + data={"pickings": self._data_for_pickings(picking)}, + message={"message_type": "error", "body": body}, + )