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
6 changes: 3 additions & 3 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,7 @@ def _set_lot_from_parse(self, picking, line):
for result in self.search_result.parse_result:
if result.type == "lot":
if self.search_result.type == "lot" and self.search_result.record:
lot_id = self.search_result.record
lot_name = lot_id.name
lot_name = self.search_result.record.name
found = True
else:
lot_name = result.value
Expand All @@ -888,7 +887,8 @@ def _set_lot_from_parse(self, picking, line):
result.type == "expiration_date"
and line.product_id.use_expiration_date
):
expiration_date = datetime.fromisoformat(result.value)
date = result.value
expiration_date = datetime(date.year, date.month, date.day)

if found:
return self.set_lot_confirm_action(
Expand Down
4 changes: 3 additions & 1 deletion shopfloor_reception/tests/test_multi_barcode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from datetime import date

import mock

from odoo import fields
Expand Down Expand Up @@ -34,7 +36,7 @@ def test_scan_multiple_attribute_barcode(self):
BarcodeResult(type="lot", value=lot.name, raw=lot.name),
BarcodeResult(
type="expiration_date",
value="2025-04-15",
value=date(2025, 4, 15),
raw="250415",
),
]
Expand Down
Loading