diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index 8269fa5d7ff..cee414c2825 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -593,18 +593,8 @@ form: module.record_id""" % (xml_id,) a_action = rec.get('action','').encode('utf8') # determine the type of action - if '.' in a_action: - # action referring to another module - a_action_module, a_action_name = a_action.split('.') - else: - # local action: use current module - a_action_module = self.module - a_action_name = a_action - - # fetch the model and the res id - ir_action_ref = self.pool.get('ir.model.data').get_object_reference(cr, self.uid, a_action_module, a_action_name) - # get the part of the model we need - a_type = ir_action_ref[0].split('.')[-1] + a_type, a_id = self.model_id_get(a_action) + a_type = a_type.split('.')[-1] # keep only type part icons = { "act_window": 'STOCK_NEW', @@ -617,7 +607,6 @@ form: module.record_id""" % (xml_id,) values['icon'] = icons.get(a_type,'STOCK_NEW') if a_type=='act_window': - a_id = self.id_get(cr, a_action) cr.execute('select view_type,view_mode,name,view_id,target from ir_act_window where id=%s', (int(a_id),)) rrres = cr.fetchone() assert rrres, "No window action defined for this id %s !\n" \ @@ -644,7 +633,6 @@ form: module.record_id""" % (xml_id,) values['name'] = action_name elif a_type in ['wizard', 'url', 'client', 'server'] and not values.get('name'): - a_id = self.id_get(cr, a_action) a_table = 'ir_act_%s' % a_type cr.execute('select name from %s where id=%%s' % a_table, (int(a_id),)) resw = cr.fetchone() @@ -682,9 +670,6 @@ form: module.record_id""" % (xml_id,) self.idref[rec_id] = int(pid) if rec.get('action') and pid: - a_action = rec.get('action').encode('utf8') - a_type = rec.get('type','').encode('utf8') or 'act_window' - a_id = self.id_get(cr, a_action) action = "ir.actions.%s,%d" % (a_type, a_id) self.pool.get('ir.model.data').ir_set(cr, self.uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(pid))], action, True, True, xml_id=rec_id) return ('ir.ui.menu', pid)