diff --git a/bi_view_editor/models/bve_view.py b/bi_view_editor/models/bve_view.py index b6b452ab..9e6ce828 100644 --- a/bi_view_editor/models/bve_view.py +++ b/bi_view_editor/models/bve_view.py @@ -7,7 +7,7 @@ import json from openerp import tools from openerp import SUPERUSER_ID from openerp import models, fields, api -from openerp.exceptions import Warning +from openerp.exceptions import Warning as UserError from openerp.tools.translate import _ @@ -66,7 +66,7 @@ class BveView(models.Model): def unlink(self): for view in self: if view.state == 'created': - raise Warning( + raise UserError( _('Error'), _('You cannot delete a created view! ' 'Reset the view to draft first.')) @@ -109,8 +109,8 @@ class BveView(models.Model): (field_info['row'] and 'row') or (field_info['column'] and 'col') or (field_info['measure'] and 'measure')) - for field_info in fields_info if field_info['row'] or - field_info['column'] or field_info['measure']] + for field_info in fields_info if field_info['row'] or + field_info['column'] or field_info['measure']] @api.multi def action_create(self): diff --git a/bi_view_editor/models/ir_model.py b/bi_view_editor/models/ir_model.py index 7433918c..c8e752b2 100644 --- a/bi_view_editor/models/ir_model.py +++ b/bi_view_editor/models/ir_model.py @@ -79,7 +79,7 @@ class IrModel(models.Model): """ model_names = dict([(model.id, model.model) for model in self.env['ir.model'].sudo().search( - [('id', 'in', model_ids.values())])]) + [('id', 'in', model_ids.values())])]) filter_bi_fields = self._filter_bi_fields if filter_bi_fields: rfields = [