Merge pull request #1284 from sebalix/8.0-fix-xmlrpc-marshall-none
authorRaphael Collet <rco@openerp.com>
Wed, 30 Jul 2014 13:05:03 +0000 (15:05 +0200)
committerRaphael Collet <rco@openerp.com>
Wed, 30 Jul 2014 13:05:03 +0000 (15:05 +0200)
[FIX] read() method returns None values instead of False, incompatible with XML-RPC

1  2 
openerp/fields.py

@@@ -617,12 -614,8 +617,12 @@@ class Field(object)
      def convert_to_read(self, value, use_name_get=True):
          """ convert `value` from the cache to a value as returned by method
              :meth:`BaseModel.read`
 +
 +            :param bool use_name_get: when True, value's diplay name will
 +                be computed using :meth:`BaseModel.name_get`, if relevant
 +                for the field
          """
-         return value
+         return False if value is None else value
  
      def convert_to_write(self, value, target=None, fnames=None):
          """ convert `value` from the cache to a valid value for method