Browse Source

Remove subclassing of exception, since there is only one.

pull/104/head
Jairo Llopis 10 years ago
parent
commit
1dbb1e0f87
  1. 14
      partner_firstname/exceptions.py

14
partner_firstname/exceptions.py

@ -19,18 +19,8 @@
from openerp import _, exceptions from openerp import _, exceptions
class PartnerNameError(exceptions.ValidationError):
def __init__(self, record, value=None):
class EmptyNames(exceptions.ValidationError):
def __init__(self, record, value=_("No name is set.")):
self.record = record self.record = record
self._value = value self._value = value
self.name = _("Error(s) with partner %d's name.") % record.id self.name = _("Error(s) with partner %d's name.") % record.id
@property
def value(self):
raise NotImplementedError()
class EmptyNames(PartnerNameError):
@property
def value(self):
return _("No name is set.")
Loading…
Cancel
Save