Browse Source

Rename exception according to PEP8.

pull/104/head
Jairo Llopis 10 years ago
parent
commit
e4decaed79
  1. 2
      partner_firstname/exceptions.py
  2. 2
      partner_firstname/models.py
  3. 2
      partner_firstname/tests/test_partner_firstname.py

2
partner_firstname/exceptions.py

@ -19,7 +19,7 @@
from openerp import _, exceptions
class EmptyNames(exceptions.ValidationError):
class EmptyNamesError(exceptions.ValidationError):
def __init__(self, record, value=_("No name is set.")):
self.record = record
self._value = value

2
partner_firstname/models.py

@ -74,7 +74,7 @@ class ResPartner(models.Model):
def _check_name(self):
"""Ensure at least one name is set."""
if not (self.firstname or self.lastname):
raise exceptions.EmptyNames(self)
raise exceptions.EmptyNamesError(self)
@api.model
def _firstname_install(self):

2
partner_firstname/tests/test_partner_firstname.py

@ -90,7 +90,7 @@ class PartnerFirstnameCase(TransactionCase):
def test_no_names(self):
"""Test that you cannot set a partner without names."""
with self.assertRaises(ex.EmptyNames):
with self.assertRaises(ex.EmptyNamesError):
self.original.firstname = self.original.lastname = False

Loading…
Cancel
Save