Skip to content

[16.0][FIX] shopfloor_reception: correct _set_quantity__by_lot signature#1156

Open
nicolas-delbovier-acsone wants to merge 1 commit intoOCA:16.0from
acsone:16.0-fix-shopfloor_reception-set-qty-by-lot
Open

[16.0][FIX] shopfloor_reception: correct _set_quantity__by_lot signature#1156
nicolas-delbovier-acsone wants to merge 1 commit intoOCA:16.0from
acsone:16.0-fix-shopfloor_reception-set-qty-by-lot

Conversation

@nicolas-delbovier-acsone
Copy link
Copy Markdown

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

The problem

When a user is in the set_quantity state 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_barcode uses 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.record provides an Odoo recordset (stock.lot). However, the implementation of _set_quantity__by_lot was incorrectly expecting a raw string (barcode as a string) instead of a recordset.

This mismatch caused:

  1. Failure when accessing attributes like lot.name.
  2. Inconsistency with other _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 the lot argument as a stock.lot recordset.

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.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

@OCA-git-bot OCA-git-bot added series:16.0 mod:shopfloor_reception Module shopfloor_reception labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:shopfloor_reception Module shopfloor_reception series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants