Skip to content

[16.0][FIX] shopfloor_reception: clearer error message in case of gs1 scan for a product without barcode#1197

Open
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception-gs1-lot_has_barcode_but_product_missing
Open

[16.0][FIX] shopfloor_reception: clearer error message in case of gs1 scan for a product without barcode#1197
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception-gs1-lot_has_barcode_but_product_missing

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Jun 26, 2026

Copy link
Copy Markdown

When scanning a GS1, we parse the GS1 data to ensure the product on the GS1 matches the barcode we have in odoo.

However, when we do not have a barcode for the given product in odoo, the error message was confusing -> Created a clearer error message

Before After
image image

cc @jbaudoux

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @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_reception Module shopfloor_reception labels Jun 26, 2026
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [16.0][FIX] shopfloor_reception: gs1 lot has barcode but product missing[IMP] shopfloor_reception: clearer error message in case of gs1 scan for a product without barcode [16.0][FIX] shopfloor_reception: clearer error message in case of gs1 scan for a product without barcode Jun 26, 2026

@jbaudoux jbaudoux left a comment

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.

My suggestion was to fill-in the screen with the scanned data even if you could not match a product with the barcode. Because the screen to set the product data like the barcode comes after the set lot screen. But we should invert those screens so that you can set the product barcode then you should not face the issue in set lot that the product has no barcode (unless you don't have the module to collect product data).
I think if you cannot confirm it's the wrong product because the scanned product barcode doesn't exist in odoo and the selected line product has no barcode, you should consider the product is right and fill the data.

Comment on lines +1235 to +1238
message = (
self.msg_store.lot_product_mismatch()
if selected_line.product_id.barcode
else self.msg_store.lot_has_barcode_but_product_missing()

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.

If I have a result of type "product", it means I scanned a barcode that matched an existing product.

If I cannot match a product, I should not enter here, isn't it?

Comment on lines +58 to +59
"The scanned lot contains a barcode but you have no "
"barcode for this product in Odoo.",

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.

Maybe also display the barcode in the message?

Suggested change
"The scanned lot contains a barcode but you have no "
"barcode for this product in Odoo.",
"The scanned lot contains a product barcode but you have no "
"product with this barcode in Odoo.",

self.selected_move_line.product_id.sudo().barcode = False

expiration_date = date(2022, 7, 2)
other_product_barcode = "01223334444555"

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.

Can you split in 2 test cases:

  • assert there is no product with this barcode => lot_has_barcode_but_product_missing
  • assert there is a another product with this barcode => lot_product_mismatch

In both cases, self.lot exists

Comment on lines 1247 to 1250
if search_result.type == "lot":
existing_lot = search_result.record
if not existing_lot:
existing_lot = search.lot_from_scan(lot_name, selected_line.product_id)

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.

When an expiration date is matched, what is the search_result?
To be sure it's not rerunning a seach while there is already the lot in the results.
The above lot_name = result.value is the lot or its barcode? I would expect result.raw to be the barcode. Is this redoing a useless second search?

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.

3 participants