[FIX] fields: error if there is no value when convert a many2many relation
Closes #1165
This commit is contained in:
parent
727f9056a3
commit
1511e788cf
|
@ -1278,6 +1278,8 @@ class sparse(function):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self._type == 'many2many':
|
if self._type == 'many2many':
|
||||||
|
if not value:
|
||||||
|
return []
|
||||||
assert value[0][0] == 6, 'Unsupported m2m value for sparse field: %s' % value
|
assert value[0][0] == 6, 'Unsupported m2m value for sparse field: %s' % value
|
||||||
return value[0][2]
|
return value[0][2]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue