From ffacce7140f22a90a46d8819274fedfc7c86c88e Mon Sep 17 00:00:00 2001 From: Ravi Gohil Date: Tue, 30 Dec 2014 18:24:14 +0530 Subject: [PATCH] [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 --- openerp/osv/orm.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index f0cec27b2cd..9cd5d1dcb8f 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -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: