[FIX] orm: export on empty one2many

When exporting the content of a one2many, if the first row got an empty value,
it was filled with the name_get of all lines and skipped the next lines.
The guessed reason of this was for the representation of the m2m lines but was
left after a proper export of m2m has been implemented (91cafbe).
This code was problematic as it prevented to properly export records with
an empty value on the first line (e.g. credit amount on account.move.line).
Fixes #4218, opw 620178
This commit is contained in:
Ravi Gohil 2014-12-30 18:24:14 +05:30 committed by Martin Trigaux
parent 5042d91330
commit ffacce7140
1 changed files with 0 additions and 11 deletions

View File

@ -1215,17 +1215,6 @@ class BaseModel(object):
for fpos2 in range(len(fields)):
if lines2 and lines2[0][fpos2]:
data[fpos2] = lines2[0][fpos2]
if not data[fpos]:
dt = ''
for rr in r:
name_relation = self.pool.get(rr._table_name)._rec_name
if isinstance(rr[name_relation], browse_record):
rr = rr[name_relation]
rr_name = self.pool.get(rr._table_name).name_get(cr, uid, [rr.id], context=context)
rr_name = rr_name and rr_name[0] and rr_name[0][1] or ''
dt += tools.ustr(rr_name or '') + ','
data[fpos] = dt[:-1]
break
lines += lines2[1:]
first = False
else: