From f070facbd1c9c3de89c9261e5d70eb38ea33dc26 Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Tue, 8 Jun 2010 14:34:59 +0200 Subject: [PATCH] [MERGE] Merged data loader fixes. bzr revid: jth@openerp.com-20100608123459-3pat73cpmyzjwu20 --- bin/addons/__init__.py | 3 +++ bin/tools/yaml_import.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index a70468cf071..0370fa9a236 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -664,6 +664,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # TODO manage .csv file with noupdate == (kind == 'init') if ext == '.sql': process_sql_file(cr, fp) + elif ext == '.csv': + noupdate = (kind == 'init') + tools.convert_csv_import(cr, module_name, file, id_map, mode, noupdate) elif ext == '.yml': tools.convert_yaml_import(cr, module_name, file, id_map, mode, noupdate) else: diff --git a/bin/tools/yaml_import.py b/bin/tools/yaml_import.py index adbb42790e5..856fe800224 100644 --- a/bin/tools/yaml_import.py +++ b/bin/tools/yaml_import.py @@ -335,7 +335,7 @@ class YamlInterpreter(object): else: raise KeyError("Object '%s' does not contain field '%s'" % (model, field_name)) if is_ref(expression): - elements = self.process_ref(expression) + elements = self.process_ref(expression, column) if column._type in ("many2many", "one2many"): value = [(6, 0, elements)] else: # many2one