Skip to content

[16.0][FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan#1157

Draft
nicolas-delbovier-acsone wants to merge 29 commits intoOCA:16.0from
acsone:16.0-fix-shopfloor_reception-set_lot-skipped-on-scan
Draft

[16.0][FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan#1157
nicolas-delbovier-acsone wants to merge 29 commits intoOCA:16.0from
acsone:16.0-fix-shopfloor_reception-set_lot-skipped-on-scan

Conversation

@nicolas-delbovier-acsone
Copy link
Copy Markdown

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Apr 17, 2026

Based on: #1128

…er readibility

Reorganized the template structure to ensure the date-picker is positioned adjacent to its related components inside the "set_lot" template.
- Merge `set_lot_confirm_action` and `set_lot` endpoints so as to call only one endpoint
- Ensures lot is not created in DB until proven valid
- Add expired expiration date check
Update the 'set_lot' state logic to store user input locally on the
active move line before calling the backend.

Crucially, this ensures the 'set_lot' function is now called with both
'expiration_date' and 'lot_name' at the same time upon confirmation.
This prevents premature backend calls with partial data and allows
for better validation of the lot on the server.
Updated unit tests to be resistant to changes in product data serialization.
Previously, tests used a hard-coded dict, which caused failures when
other modules modified the product's serialized fields.
Add an endpoint to call on lot name scan. This enables to detect already existing lots.
This endpoint could also be used to add logic to extract extra infos from barcode such as expiration date.
When a user provides a lot name but forgets the expiration date, the `lot_name` was previously lost
in the response.

This change ensures that `lot_name` is included in the returned
data, allowing the UI to retain the value and
preventing the user from having to re-type it.
The frontend was sending expiration dates in the user's local timezone. Because Odoo expects datetime values in UTC, this caused "hour shifts" that could move the expiration date to the previous day in the database.

This fix ensures that the selected date is treated as local midnight and converted to the corresponding UTC timestamp before being sent to the server.
…display

Updated the lot expiration display to show only the date component. Since the selection widget is restricted to dates, displaying the time was redundant.
…trings

- Rename internal methods to follow standard naming conventions, ensuring compatibility for downstream modules inheriting from this component.
- Updated docstrings to accurately reflect method behavior.
The 'UTC=timezone.utc' alias was introduced in Python 3.11.
To maintain support for environments running Python 3.10,  the alias is added manually at the beginning of the file
Enforce the 'use_create_lots' setting from the picking type during the
reception process.
… screen

The logic for the cancel action was defined, but the event listener
was missing from the button template.
When a lot name is present on the move line, the system now attempts to find a matching existing
lot record. If found, the lot metadata is sent to the frontend to
pre-fill the screen, preventing redundant data entry.
Update '_response_for_set_lot' to check if lot information was already
resolved during parsing. If the parsed data is complete, the system now
bypasses the 'set_lot' entry screen and processes the confirmation
automatically.
…ction`

Break down the function into smaller functions to isolate responsability and make code more readable
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @sebalix, @simahawk, @guewen, @mmequignon, @JuMiSanAr,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:16.0 mod:shopfloor Module shopfloor mod:shopfloor_reception Module shopfloor_reception mod:shopfloor_reception_mobile Module shopfloor_reception_mobile labels Apr 17, 2026
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan [146.0][FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan Apr 17, 2026
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [146.0][FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan [16.0][FIX] shopfloor_reception: make sure "set_lot" is skipped on existing lot scan Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:shopfloor_reception_mobile Module shopfloor_reception_mobile mod:shopfloor_reception Module shopfloor_reception mod:shopfloor Module shopfloor series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants