[16.0][FIX] shopfloor_reception: correct _set_quantity__by_lot signature#1156
Open
nicolas-delbovier-acsone wants to merge 1 commit intoOCA:16.0from
Open
[16.0][FIX] shopfloor_reception: correct _set_quantity__by_lot signature#1156nicolas-delbovier-acsone wants to merge 1 commit intoOCA:16.0from
nicolas-delbovier-acsone wants to merge 1 commit intoOCA:16.0from
Conversation
The handler `_set_quantity__by_lot` was incorrectly expecting a string as its third argument. However, the dispatcher `_set_quantity__by_barcode` passes `search_result.record` (a recordset). This mismatch caused a 500 error during the "set qty" state when scanning a lot barcode.
Contributor
|
Hi @JuMiSanAr, @mmequignon, |
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.
The problem
When a user is in the
set_quantitystate of a Reception and scans a Lot/Serial barcode, the system would raise a 500 error due to an invalid method signature in the reception component.Technical Reason
The dispatcher method
_set_quantity__by_barcodeuses the Shopfloor search service to identify the scanned barcode. Once identified as a lot, it calls the corresponding handler:handler(picking, selected_line, search_result.record)The
search_result.recordprovides an Odoo recordset (stock.lot). However, the implementation of_set_quantity__by_lotwas incorrectly expecting a raw string (barcodeas a string) instead of a recordset.This mismatch caused:
lot.name._set_quantity__by_*handlers (like product or packaging) which all receive recordsets.Changes
Updated
_set_quantity__by_lot(self, picking, selected_line, lot)to correctly handle thelotargument as astock.lotrecordset.