From 982a95be2f95fd414458f3aff84aefa3576bcf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Mar 2012 11:45:51 +0100 Subject: [PATCH] Add missing sql_format in "like" clauses issue2478 review270002 (transplanted from 0fe90cd57f000b9382d9859f47bfea0d62c8e23c) --- trytond/model/modelsql.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py index db1046d9e5..a578a8eaca 100644 --- a/trytond/model/modelsql.py +++ b/trytond/model/modelsql.py @@ -1822,12 +1822,16 @@ class ModelSQL(ModelStorage): qu2.append('%') add_null = True else: - qu2.append(arg[2]) + qu2.append(FIELDS[ + table._columns[arg[0]]._type + ].sql_format(arg[2])) elif arg[1] in ('not like', 'not ilike'): if not arg[2]: qu2.append('') else: - qu2.append(arg[2]) + qu2.append(FIELDS[ + table._columns[arg[0]]._type + ].sql_format(arg[2])) add_null = True else: if arg[0] in table._columns: