diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index 054ecf9d045..7bbc9554b46 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -171,8 +171,11 @@ class view(osv.osv): if context and key in context: imd = context[key] if self._model._name == imd['model'] and (not view.xml_id or view.xml_id == imd['xml_id']): - # we store the relative path to the resource instead of the absolute path - data['arch_fs'] = '/'.join(get_resource_from_path(imd['xml_file'])[0:2]) + # we store the relative path to the resource instead of the absolute path, if found + # (it will be missing e.g. when importing data-only modules using base_import_module) + path_info = get_resource_from_path(imd['xml_file']) + if path_info: + data['arch_fs'] = '/'.join(path_info)[0:2] self.write(cr, uid, ids, data, context=context) return True