[FIX] null properties

bzr revid: fp@tinyerp.com-20100612164935-b1a3hx7ron32kwxk
This commit is contained in:
Fabien Pinckaers
2010-06-12 18:49:35 +02:00
parent c329414338
commit fd1c8a5b83
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -885,7 +885,7 @@ class property(function):
default_value = prop.get_by_id(cr, uid, ids, context=context)
if isinstance(default_value, browse_record):
return default_value.id
return default_value
return default_value or False
def _get_by_id(self, obj, cr, uid, prop_name, ids, context=None):
prop = obj.pool.get('ir.property')
+2 -1
View File
@@ -131,8 +131,9 @@ class osv_pool(netsvc.Service):
if method.startswith('_'):
raise except_osv('Access Denied', 'Private methods (such as %s) cannot be called remotely.' % (method,))
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
print 'Got RES', res
if res is None:
self.logger.warning('The method %s of the object %s can not return `None` at the moment!', method, obj )
self.logger.warning('The method %s of the object %s can not return `None` !', method, obj)
cr.commit()
except Exception:
cr.rollback()