Files
odoo_source/addons/website/models
Benoit Socias fdd30e368c [FIX] website: survive to null texts during trigram search
Generic search bar was introduced with #65871.
But the trigram search would fail if it encounters a (SQL) NULL text
from the database. This is because when word_similarity() receives NULL
as a parameter it returns NULL, and NULL not being a number cannot be
compared with the similarity threshold.

After this commit the trigram search will exclude matches returning a
NULL similarity.

Step to reproduce:
  - Enable trigram in the DB, run `CREATE EXTENSION pg_trgm;` in psql
  - Create a product, name it `myproduct`
  - Insert NULL values inside the translation table (not sure how the
    user did it):
    `update ir_translation set value = NULL where src = 'myproduct';`
  - Search 'mypro' in the eshop search bar
    -> Traceback

opw-2680659

closes odoo/odoo#80426

X-original-commit: ef17edc32d4646c93e31e730249be83469951241
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-26 14:26:31 +00:00
..
…
…