Skip to content

Commit 981e94b

Browse files
committed
[FIX] util/records: correct query construction
Check that there are unique columns to expand the extra conditions. closes #39 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 415fc94 commit 981e94b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def replace_record_references_batch(cr, id_mapping, model_src, model_dst=None, r
11781178
"""
11791179
NOT EXISTS(SELECT 1 FROM {ir.table} WHERE {res_model_whr} AND {jmap_expr} AND %(ands)s)
11801180
"""
1181-
% {"ands": "AND".join('"%s"=t."%s"' % (col, col) for col in uniq_cols)}
1181+
% {"ands": "AND".join('"%s"=t."%s"' % (col, col) for col in uniq_cols) if uniq_cols else "True"}
11821182
)
11831183
query = """
11841184
%s

0 commit comments

Comments
 (0)