[FIX] fields: error if there is no value when convert a many2many relation

Closes #1165
This commit is contained in:
Laetitia Gangloff 2014-07-15 10:44:19 +02:00 committed by Denis Ledoux
parent 727f9056a3
commit 1511e788cf
1 changed files with 2 additions and 0 deletions

View File

@ -1278,6 +1278,8 @@ class sparse(function):
"""
if self._type == 'many2many':
if not value:
return []
assert value[0][0] == 6, 'Unsupported m2m value for sparse field: %s' % value
return value[0][2]