From 5766b3cd04c17dc51d9d76047eaff6dc21e4f2d3 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 13 May 2009 14:43:03 +0530 Subject: [PATCH] [FIX] DB will save False Valuesfor booleans bzr revid: jvo@tinyerp.com-20090513091303-tyoe0u8bx6v8mgtt --- bin/osv/orm.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index cfc311102eb..4e51dc454df 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2405,7 +2405,15 @@ class orm(orm_template): upd0 += ','+self._inherits[table] upd1 += ',%s' upd2.append(id) - + + #Start : Set bool fields to be False if they are not touched(to make search more powerful) + bool_fields = [x for x in self._columns.keys() if self._columns[x]._type=='boolean'] + + for bool_field in bool_fields: + if bool_field not in vals: + vals[bool_field] = False + #End + for field in vals: if self._columns[field]._classic_write: upd0 = upd0 + ',"' + field + '"'