From 461973b4c9abfcd7bd5080cd2f999495c5687d2e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 27 Mar 2013 16:54:24 +0100 Subject: [PATCH] [IMP] usage of python in convert_csv * the reduce is equivalent to any * apply De Morgan law * misc.ustr is a function, can just pass it directly to map bzr revid: xmo@openerp.com-20130327155424-dfbo915tl8qhsvqu --- openerp/tools/convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index 59e66512da4..55ca1c1ce9c 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -915,10 +915,10 @@ def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init', uid = 1 datas = [] for line in reader: - if (not line) or not reduce(lambda x,y: x or y, line) : + if not (line and any(line)): continue try: - datas.append(map(lambda x: misc.ustr(x), line)) + datas.append(map(misc.ustr, line)) except: _logger.error("Cannot import the line: %s", line) result, rows, warning_msg, dummy = pool.get(model).import_data(cr, uid, fields, datas,mode, module, noupdate, filename=fname_partial)