WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@TTalex
Copy link
Collaborator

@TTalex TTalex commented Oct 4, 2025

What

  • When loading price tags predictions, use the best (first) similar barcode if available, and if barcode is invalid

Note: this could also be done in the backend ?

productPriceForm.similar_barcodes = label.similar_barcodes
// if there is a similar barcode, it's probably better than the guessed one if it's invalid
if (!barcode_utils.isBarcodeValid(productPriceForm.product_code)) {
productPriceForm.product_code = label.similar_barcodes[0].barcode
Copy link
Member

Choose a reason for hiding this comment

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

what about giving the user the choice ? for instance:

  • replacing the "invalid" product section with a message/banner
  • having the "Find the product" display the whole (or a subset) of the similar_barcodes list ?

Copy link
Member

@raphodn raphodn Oct 4, 2025

Choose a reason for hiding this comment

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

ah kinda like #1724 yeah ^^ + we "force" the user to go through the BarcodeScannerDialog, instead of validating a very-likely-wrong product

Copy link
Collaborator Author

@TTalex TTalex Oct 4, 2025

Choose a reason for hiding this comment

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

Yeah, I was thinking the same, so I implemented both options to choose from :D

@TTalex
Copy link
Collaborator Author

TTalex commented Nov 2, 2025

Will not merge, see #1724 for a better approach.

@TTalex TTalex closed this Nov 2, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in 💸 Open Prices Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants