From 21b9caa46b03594f484dc2233bc0a5c93c706cf5 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Dec 2010 18:00:54 +0100 Subject: [PATCH] fix bzr revid: fp@tinyerp.com-20101227170054-ochgr9x88l4wun2x --- bin/osv/orm.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index cf6d754f8db..65e90922794 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -747,6 +747,7 @@ class orm_template(object): row = {} warning = [] data_res_id = False + xml_id = False nbrmax = position+1 done = {} @@ -765,7 +766,11 @@ class orm_template(object): # ID of the record using a XML ID if field[len(prefix)]=='id': - data_res_id = _get_id(model_name, line[i], current_module, 'id') + try: + data_res_id = _get_id(model_name, line[i], current_module, 'id') + except ValueError, e: + pass + xml_id = line[i] continue # ID of the record using a database ID @@ -787,7 +792,7 @@ class orm_template(object): res2 = process_liness(self, datas, prefix + [field[len(prefix)]], current_module, relation_obj._name, newfd, pos, first) if not res2: break - (newrow, pos, w2, data_res_id2) = res2 + (newrow, pos, w2, data_res_id2, xml_id2) = res2 nbrmax = max(nbrmax, pos) warning += w2 first += 1 @@ -837,7 +842,7 @@ class orm_template(object): row[field[len(prefix)]] = res or False - result = (row, nbrmax, warning, data_res_id) + result = (row, nbrmax, warning, data_res_id, xml_id) return result fields_def = self.fields_get(cr, uid, context=context) @@ -850,7 +855,7 @@ class orm_template(object): while position