Skip to content

[16.0][FIX] shopfloor: handle invalid product error gracefully on lot scan - #1250

Open
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor-cluster-picking-500-error-on-invalid-product
Open

[16.0][FIX] shopfloor: handle invalid product error gracefully on lot scan#1250
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor-cluster-picking-500-error-on-invalid-product

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Sep 1, 2026

Copy link
Copy Markdown

When scanning a barcode containing both product and lot info for a product
different from the current line, a SearchInvalidProduct exception was
uncaught in cluster_picking, leading to an unhandled 500 internal server
error in the Shopfloor application.

cc @jbaudoux

When scanning a barcode containing both product and lot info for a product
different from the current line, a `SearchInvalidProduct` exception was
uncaught in `cluster_picking`, leading to an unhandled 500 internal server
error in the Shopfloor application.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

Comment thread shopfloor/tests/test_cluster_picking_scan_line.py
Comment thread shopfloor/tests/test_cluster_picking_scan_line.py
@jbaudoux

jbaudoux commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-1250-by-jbaudoux-bump-patch, awaiting test results.

Comment on lines +505 to +506
lot = None
lot = search.lot_from_scan(barcode, products=move_line.product_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why lot = None? Could be removed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it cannot. But would be maybe more understandable if outside try.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the variable is not initialized, the rest of the code will fail in case lot_from_scan raises an error.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@jbaudoux

Copy link
Copy Markdown
Contributor

@nicolas-delbovier-acsone needs rebase for merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants