diff options
| author | HDA (OpenERP) <hda@tinyerp.com> | 2010-03-03 12:51:09 +0530 |
|---|---|---|
| committer | HDA (OpenERP) <hda@tinyerp.com> | 2010-03-03 12:51:09 +0530 |
| commit | bca733707d0ea11c8c6b57dbde69b062e2c35ee3 (patch) | |
| tree | 36347fbd3e3fd8b49e43e696abdee9c4ad49042a | |
| parent | 33749177de30de1b98cf9317c60e2394aeca94dd (diff) | |
added noupdate=1 if csv is in init_xml
bzr revid: hda@tinyerp.com-20100303072109-qoi1h70ohfsjq96h
| -rw-r--r-- | bin/addons/__init__.py | 5 | ||||
| -rw-r--r-- | bin/osv/fields.py | 2 | ||||
| -rw-r--r-- | bin/tools/convert.py | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index b147db854ef..2910b9fe7c1 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -634,7 +634,10 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): name, ext = os.path.splitext(filename) fp = tools.file_open(opj(m, filename)) if ext == '.csv': - tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode) + noupdate=False + if kind == 'init': + noupdate=True + tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode, noupdate=noupdate) elif ext == '.sql': queries = fp.read().split(';') for query in queries: diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 3d47cfb08f5..4398c896a5a 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -778,7 +778,6 @@ class related(function): res[data.id] = t_data.id else: res[data.id] = t_data - if self._type=='many2one': ids = filter(None, res.values()) if ids: @@ -790,7 +789,6 @@ class related(function): for r in res: if res[r]: res[r] = [x.id for x in res[r]] - return res def __init__(self, *arg, **args): diff --git a/bin/tools/convert.py b/bin/tools/convert.py index 4314651d084..d4f3d86b9ae 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -838,7 +838,7 @@ def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init', except: logger = netsvc.Logger() logger.notifyChannel("init", netsvc.LOG_ERROR, "Cannot import the line: %s" % line) - pool.get(model).import_data(cr, uid, fields, datas,mode, module,noupdate,filename=fname_partial) + pool.get(model).import_data(cr, uid, fields, datas,mode, module, noupdate, filename=fname_partial) if config.get('import_partial'): data = pickle.load(file(config.get('import_partial'))) data[fname_partial] = 0 |
