Skip to content

Commit e1c9190

Browse files
committed
[IMP] util/indirect_references: return SQLStr as model filter
This would make it less verbose in `util.format_query`. closes #210 Related: odoo/upgrade#7203 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 46a9980 commit e1c9190

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/indirect_references.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import collections
33

44
from .helpers import model_of_table, table_of_model
5-
from .pg import column_exists, table_exists
5+
from .pg import SQLStr, column_exists, table_exists
66

77

88
class IndirectReference(
@@ -21,9 +21,9 @@ def model_filter(self, prefix="", placeholder="%s"):
2121

2222
if column is None:
2323
# `model` is not set when `company_dependent_comodel` is.
24-
return "(false AND {} IS NULL)".format(placeholder)
24+
return SQLStr("(false AND {} IS NULL)".format(placeholder))
2525

26-
return '{}"{}"={}'.format(prefix, column, placeholder)
26+
return SQLStr('{}"{}"={}'.format(prefix, column, placeholder))
2727

2828

2929
# By default, there is no `res_id`, no `res_model_id` and it is deleted when the linked model is removed

0 commit comments

Comments
 (0)