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
closesodoo/odoo#80426
X-original-commit: ef17edc32d4646c93e31e730249be83469951241
Signed-off-by: Romain Derie (rde) <rde@odoo.com>