diff --git a/src/util/helpers.py b/src/util/helpers.py index 1929bb85f..09087d3b1 100644 --- a/src/util/helpers.py +++ b/src/util/helpers.py @@ -279,6 +279,8 @@ def resolve_model_fields_path(cr, model, path): :return: resolved fields path parts :rtype: list(:class:`~odoo.upgrade.util.helpers.FieldsPathPart`) """ + if not path: + return [] path = list(path) cr.execute( """ diff --git a/src/util/records.py b/src/util/records.py index ff015d9e2..1c0014cf8 100644 --- a/src/util/records.py +++ b/src/util/records.py @@ -492,6 +492,8 @@ def _remove_import_export_paths(cr, model, field=None): """ if field: export_q = cr.mogrify(export_q + " WHERE el.name ~ %s ", [r"\y{}\y".format(field)]).decode() + else: + export_q += " WHERE el.name IS NOT NULL" import_q = """ SELECT id, @@ -501,6 +503,8 @@ def _remove_import_export_paths(cr, model, field=None): """ if field: import_q = cr.mogrify(import_q + " WHERE field_name ~ %s ", [r"\y{}\y".format(field)]).decode() + else: + import_q += " WHERE field_name IS NOT NULL " for query, impex_model in [(export_q, "ir.exports.line"), (import_q, "base_import.mapping")]: cr.execute(query)