[FIX] models: export of booleans

In the case of a `raw_data` export, a boolean which has the value
`False` will not be exported correctly.

The fix handles the `False` value as a valid value for a field.

opw-666142
This commit is contained in:
Nicolas Martinelli 2016-02-23 10:52:55 +01:00
parent ee33593351
commit 68f9f99ed3
1 changed files with 2 additions and 2 deletions

View File

@ -907,10 +907,10 @@ class BaseModel(object):
if lines2:
# merge first line with record's main line
for j, val in enumerate(lines2[0]):
if val:
if val or isinstance(val, bool):
current[j] = val
# check value of current field
if not current[i]:
if not current[i] and not isinstance(current[i], bool):
# assign xml_ids, and forget about remaining lines
xml_ids = [item[1] for item in value.name_get()]
current[i] = ','.join(xml_ids)