
from openerp import _, exceptions


class PartnerNameError(exceptions.ValidationError):
    def __init__(self, record, value=None):
        self.record = record
        self._value = value
        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.")


from openerp import _, exceptions


class EmptyNames(exceptions.ValidationError):
    def __init__(self, record, value=_("No name is set.")):
        self.record = record
        self._value = value
        self.name = _("Error(s) with partner %d's name.") % record.id

Remove subclassing of exception, since there is only one.
Remove subclassing of exception, since there is only one.

  
  from openerp import _, exceptions
  
  
- class PartnerNameError(exceptions.ValidationError):
+ class EmptyNames(exceptions.ValidationError):
-     def __init__(self, record, value=None):
+     def __init__(self, record, value=_("No name is set.")):
          self.record = record
          self._value = value
          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.")
- 
Remove subclassing of exception, since there is only one.
## Code Before:

from openerp import _, exceptions


class PartnerNameError(exceptions.ValidationError):
    def __init__(self, record, value=None):
        self.record = record
        self._value = value
        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.")

## Instruction:
Remove subclassing of exception, since there is only one.
## Code After:

from openerp import _, exceptions


class EmptyNames(exceptions.ValidationError):
    def __init__(self, record, value=_("No name is set.")):
        self.record = record
        self._value = value
        self.name = _("Error(s) with partner %d's name.") % record.id
