Browse Source

base_optional_quick_create: fix bug detected by pylint

pull/387/head
Stéphane Bidoul 8 years ago
parent
commit
5c1ca01bdf
  1. 9
      base_optional_quick_create/models/ir_model.py

9
base_optional_quick_create/models/ir_model.py

@ -2,10 +2,9 @@
# © 2013 Agile Business Group sagl (<http://www.agilebg.com>) # © 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# © 2016 ACSONE SA/NA (<http://acsone.eu>) # © 2016 ACSONE SA/NA (<http://acsone.eu>)
from openerp import api, fields, models
from openerp.exceptions import Warning
from openerp import api, fields, models, _
from openerp.exceptions import UserError
from openerp import SUPERUSER_ID from openerp import SUPERUSER_ID
from openerp.tools.translate import _
class IrModel(models.Model): class IrModel(models.Model):
@ -17,9 +16,7 @@ class IrModel(models.Model):
def _wrap_name_create(): def _wrap_name_create():
def wrapper(self, cr, uid, name, context=None): def wrapper(self, cr, uid, name, context=None):
raise orm.except_orm(
_('Error'),
_("Can't create quickly. Opening create form"))
raise UserError(_("Can't create quickly. Opening create form"))
return wrapper return wrapper
for model in self.browse(cr, SUPERUSER_ID, ids): for model in self.browse(cr, SUPERUSER_ID, ids):

Loading…
Cancel
Save