[FIX] orm: fixed problem on function field with store=True in create method
authorHarry (Open ERP) <hmo@tinyerp.com>
Thu, 1 Apr 2010 13:37:42 +0000 (19:07 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Thu, 1 Apr 2010 13:37:42 +0000 (19:07 +0530)
bzr revid: hmo@tinyerp.com-20100401133742-lnq4fhjvishnl10i

bin/osv/orm.py

index 6b78c18..430745d 100644 (file)
@@ -3269,8 +3269,9 @@ class orm(orm_template):
                         upd0.append('"'+v+'"='+self._columns[v]._symbol_set[0])
                         upd1.append(self._columns[v]._symbol_set[1](value[v]))
                     upd1.append(id)
-                    cr.execute('update "' + self._table + '" set ' + \
-                        string.join(upd0, ',') + ' where id = %s', upd1)
+                    if upd0 and upd1:
+                        cr.execute('update "' + self._table + '" set ' + \
+                            string.join(upd0, ',') + ' where id = %s', upd1)
 
             else:
                 for f in val: