summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2009-05-13 14:43:03 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-05-13 14:43:03 +0530
commit5766b3cd04c17dc51d9d76047eaff6dc21e4f2d3 (patch)
tree7a85fee3072a300f1b72c55ee37162b99c6cf10a /bin
parent68a11758fa4ae0e424963e96f81f62ac56a969ea (diff)
[FIX] DB will save False Valuesfor booleans
bzr revid: jvo@tinyerp.com-20090513091303-tyoe0u8bx6v8mgtt
Diffstat (limited to 'bin')
-rw-r--r--bin/osv/orm.py10
1 files changed, 9 insertions, 1 deletions
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 + '"'