diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index fc9ae1dec16..e3af96206dc 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1294,13 +1294,16 @@ class Export(View): records = [] for field_name, field in fields_sequence: - if import_compat and (exclude and field_name in exclude): - continue - if import_compat and field.get('readonly'): - # If none of the field's states unsets readonly, skip the field - if all(dict(attrs).get('readonly', True) - for attrs in field.get('states', {}).values()): + if import_compat: + if exclude and field_name in exclude: continue + if 'function' in field: + continue + if field.get('readonly'): + # If none of the field's states unsets readonly, skip the field + if all(dict(attrs).get('readonly', True) + for attrs in field.get('states', {}).values()): + continue id = prefix + (prefix and '/'or '') + field_name name = parent_name + (parent_name and '/' or '') + field['string'] diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 7f4af7b35bb..3d626db125d 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -111,7 +111,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ }); } _(fields).each(function (field, field_name) { - if (field_name === 'id') { return; } + // Ignore spec for id field + // Don't import function fields (function and related) + if (field_name === 'id' || 'function' in field) { + return; + } var f = { id: field_name, name: field_name,