[16.0][REF] shopfloor_reception/mobile: buffer lot inputs in UI#1128
Open
nicolas-delbovier-acsone wants to merge 28 commits intoOCA:16.0from
Open
[16.0][REF] shopfloor_reception/mobile: buffer lot inputs in UI#1128nicolas-delbovier-acsone wants to merge 28 commits intoOCA:16.0from
nicolas-delbovier-acsone wants to merge 28 commits intoOCA:16.0from
Conversation
…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
Contributor
|
Hi @JuMiSanAr, @mmequignon, |
Author
Author
|
This PR is a rework of: #1072 |
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.
bd7e41a to
4f12ac4
Compare
00231e3 to
549e000
Compare
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.
…t name scan Refactoring ideas in: OCA@3469638 and OCA@c5f931b
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.
549e000 to
1ae4499
Compare
…f date picker component" This reverts commit dd38ea0.
…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.
…iration date on a lot
940bf2f to
464dc81
Compare
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.
464dc81 to
3ad00c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the
set_lotfunction/endpoint previously carried too many responsibilities and could be called in different contexts (only a name, only a date, both). Moreover, the "set_lot" state in the shopfloor "reception" scenario called this backend endpoint immediately upon scanning a lot name or picking a date. This "eager" synchronization often resulted in:stock.lotrecords were created in the database even if the user realized they scanned the wrong barcode or made a typo before finishing the step.Main Changes
This PR refactors the synchronization logic between the VueJS frontend and the Odoo backend to move from an incremental update pattern to an atomic confirmation pattern. The main changes includes:
Also includes
This PR is a rework of: #1072