From eab36ac71fc3f02a1475b4e771b1dc2744f7edd1 Mon Sep 17 00:00:00 2001 From: ced <> Date: Tue, 31 Jul 2007 14:08:52 +0000 Subject: [PATCH] kernel: allow id in csv file without module prefix bzr revid: ced-e58d8435a0aac09342841880680750a0f58fcd0e --- bin/osv/orm.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index ec5a2fcef4c..6be4e263397 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -610,7 +610,10 @@ class orm(object): if fields_def[field[len(prefix)][:-3]]['type']=='many2many': res_id = [] for word in line[i].split(','): - module, xml_id = word.rsplit('.', 1) + if '.' in word: + module, xml_id = word.rsplit('.', 1) + else: + module, xml_id = current_module, word ir_model_data_obj = self.pool.get('ir.model.data') id=ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id2=ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] @@ -619,7 +622,10 @@ class orm(object): if len(res_id): res_id=[(6,0,res_id)] else: - module, xml_id = line[i].rsplit('.', 1) + if '.' in line[i]: + module, xml_id = line[i].rsplit('.', 1) + else: + module, xml_id = current_module, line[i] ir_model_data_obj = self.pool.get('ir.model.data') id=ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id=ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id']