|
|
@ -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.')) |
|
|
|