[IMP] fields.boolean: simplify symbol_set, cast to bool
authorOlivier Dony <odo@openerp.com>
Mon, 11 Aug 2014 10:37:44 +0000 (12:37 +0200)
committerOlivier Dony <odo@openerp.com>
Mon, 11 Aug 2014 10:37:52 +0000 (12:37 +0200)
In combination with f28be81, this should help speed up
initialization of new boolean columns. psycopg2 handles
bool parameters values just fine inside cr.mogrify()

openerp/osv/fields.py

index 2d9c38b..7a0c362 100644 (file)
@@ -189,7 +189,7 @@ class _column(object):
 class boolean(_column):
     _type = 'boolean'
     _symbol_c = '%s'
-    _symbol_f = lambda x: x and 'True' or 'False'
+    _symbol_f = bool
     _symbol_set = (_symbol_c, _symbol_f)
 
     def __init__(self, string='unknown', required=False, **args):