Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
32 changes: 32 additions & 0 deletions shopfloor_reception/tests/test_select_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
Loading