diff --git a/trytond/trytond/model/fields/field.py b/trytond/trytond/model/fields/field.py index 0549f0a4d1..fc6b2b01f6 100644 --- a/trytond/trytond/model/fields/field.py +++ b/trytond/trytond/model/fields/field.py @@ -1,7 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import warnings -from functools import wraps +from functools import partial, wraps import sql from sql import ( @@ -234,10 +234,10 @@ def order_method(func): SQL_OPERATORS = { '=': operators.Equal, '!=': operators.NotEqual, - 'like': operators.Like, - 'not like': operators.NotLike, - 'ilike': operators.ILike, - 'not ilike': operators.NotILike, + 'like': partial(operators.Like, escape='\\'), + 'not like': partial(operators.NotLike, escape='\\'), + 'ilike': partial(operators.ILike, escape='\\'), + 'not ilike': partial(operators.NotILike, escape='\\'), 'in': operators.In, 'not in': operators.NotIn, '<=': operators.LessEqual,