Fix default value for Many2One on auto init
This commit is contained in:
1 parent
bf3b5c6779
commit
9fdbb06d1e
1 file changed
+3
@@ -490,6 +490,9 @@ class ORM(object):
|
||||
"SET \"%s\" = NULL" % \
|
||||
(self._table, k))
|
||||
else:
|
||||
if isinstance(field, fields.Many2One) \
|
||||
and isinstance(default, (list, tuple)):
|
||||
default = default[0]
|
||||
cursor.execute("UPDATE \"%s\" " \
|
||||
"SET \"%s\" = '%s'" % \
|
||||
(self._table, k, default))
|
||||
|
||||
Reference in new issue
Block a user