Skip to content

Commit 79761bf

Browse files
KangOlcawo-odoo
authored andcommitted
[IMP] snippets.convert_html_columns
Early return when there is no queries to execute. closes #137 Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
1 parent cef1907 commit 79761bf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/util/snippets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ def convert_html_columns(cr, table, columns, converter_callback, where_column="I
298298
(base_select_query + "\n AND id BETWEEN {} AND {}".format(*x))
299299
for x in determine_chunk_limit_ids(cr, table, columns, "({}) AND ({})".format(where, extra_where))
300300
]
301+
if not split_queries:
302+
return
301303

302304
update_sql = ", ".join(f'"{column}" = %({column})s' for column in columns)
303305
update_query = f"UPDATE {table} SET {update_sql} WHERE id = %(id)s"

0 commit comments

Comments
 (0)