[FIX] orm: raise NotImplementedError instead of strings
authorolt@tinyerp.com <>
Wed, 26 May 2010 14:52:10 +0000 (16:52 +0200)
committerolt@tinyerp.com <>
Wed, 26 May 2010 14:52:10 +0000 (16:52 +0200)
bzr revid: olt@tinyerp.com-20100526145210-45g3l088lta8iktn

bin/osv/orm.py

index fd20ba8..7b531bb 100644 (file)
@@ -912,7 +912,7 @@ class orm_template(object):
         return (done, 0, 0, 0)
 
     def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
-        raise _('The read method is not implemented on this object !')
+        raise NotImplementedError(_('The read method is not implemented on this object !'))
 
     def get_invalid_fields(self,cr,uid):
         return list(self._invalids)
@@ -940,16 +940,16 @@ class orm_template(object):
         return {}
 
     def perm_read(self, cr, user, ids, context=None, details=True):
-        raise _('The perm_read method is not implemented on this object !')
+        raise NotImplementedError(_('The perm_read method is not implemented on this object !'))
 
     def unlink(self, cr, uid, ids, context=None):
-        raise _('The unlink method is not implemented on this object !')
+        raise NotImplementedError(_('The unlink method is not implemented on this object !'))
 
     def write(self, cr, user, ids, vals, context=None):
-        raise _('The write method is not implemented on this object !')
+        raise NotImplementedError(_('The write method is not implemented on this object !'))
 
     def create(self, cr, user, vals, context=None):
-        raise _('The create method is not implemented on this object !')
+        raise NotImplementedError(_('The create method is not implemented on this object !'))
 
     # returns the definition of each field in the object
     # the optional fields parameter can limit the result to some fields
@@ -1417,19 +1417,19 @@ class orm_template(object):
 
     def search(self, cr, user, args, offset=0, limit=None, order=None,
             context=None, count=False):
-        raise _('The search method is not implemented on this object !')
+        raise NotImplementedError(_('The search method is not implemented on this object !'))
 
     def name_get(self, cr, user, ids, context=None):
-        raise _('The name_get method is not implemented on this object !')
+        raise NotImplementedError(_('The name_get method is not implemented on this object !'))
 
     def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80):
-        raise _('The name_search method is not implemented on this object !')
+        raise NotImplementedError(_('The name_search method is not implemented on this object !'))
 
     def copy(self, cr, uid, id, default=None, context=None):
-        raise _('The copy method is not implemented on this object !')
+        raise NotImplementedError(_('The copy method is not implemented on this object !'))
 
     def exists(self, cr, uid, id, context=None):
-        raise _('The exists method is not implemented on this object !')
+        raise NotImplementedError(_('The exists method is not implemented on this object !'))
 
     def read_string(self, cr, uid, id, langs, fields=None, context=None):
         res = {}
@@ -2972,7 +2972,7 @@ class orm(orm_template):
     # TODO: Validate
     #
     def perm_write(self, cr, user, ids, fields, context=None):
-        raise _('This method does not exist anymore')
+        raise NotImplementedError(_('This method does not exist anymore'))
 
     # TODO: ameliorer avec NULL
     def _where_calc(self, cr, user, args, active_test=True, context=None):