Wednesday, February 12, 2025
1 change · saas-17.4
Resolved issues and error corrections
Point of Sale product searches now return consistent results regardless of whether customers or staff type product names in uppercase, lowercase, or mixed case. This helps cashiers find the right items faster and avoids confusion when product names and references use similar words.
Original PR description
Currently, when searching for products using the searchBar, the results can be different depending on the way you write the same word ('desk', 'DESK', 'Desk') Steps to reproduce: -------------------…
Currently, when searching for products using the searchBar, the results can be different depending on the way you write the same word ('desk', 'DESK', 'Desk')
Steps to reproduce:
-------------------
* Create 2 products
* Product 1: name: "Blue DESK"
* Product 2: name: "Work table", reference: 'DESK_01'
* Open pos shop
* Search "desk"
> Observation: "Blue DESK" product is found, not "Work table"
* Search "DESK"
> Observation: "Work table" product is found, not "Blue DESK"
Why the fix:
------------
The behavior originates from https://github.com/odoo/odoo/commit/e9a27425a0c0b9da982aeaaec2accfa968ed1816
When doing a search, it looks for exact matches with the fields `barcode` and `default_code` and returns them, without looking for the matches in name. This is what happens when we search for "DESK" (simple example, the searchword should be greater than 5).
When we search for 'desk', no exact match is found as the function `exactMatches` is case sensitive. We then find the product thanks to `fuzzyLookup`.
This fix includes the name of the product in the exact match search and does not make it upper/lower case sensitive.
opw-4532712