Improve ir.value for wizard when the xml is set before the wizard

bzr revid: ced-e33901e1b0376bf6316152b30177248e00391113
This commit is contained in:
ced 2007-08-22 05:16:58 +00:00
parent 2fc2d9c6af
commit c4509de453
2 changed files with 6 additions and 2 deletions

View File

@ -149,7 +149,11 @@ class ir_values(osv.osv):
def _result_get(x):
if x[3]:
model,id = x[2].split(',')
datas = self.pool.get(model).read(cr, uid, [int(id)], False, context)
try:
id = int(id)
except:
return False
datas = self.pool.get(model).read(cr, uid, [id], False, context)
if not len(datas):
#ir_del(cr, uid, x[0])
return False

View File

@ -268,7 +268,7 @@ class xml_import(object):
id = self.pool.get('ir.model.data')._update(cr, self.uid, "ir.actions.wizard", self.module, res, xml_id, mode=self.mode)
self.idref[xml_id] = id
# ir_set
if not rec.hasAttribute('menu') or eval(rec.getAttribute('menu')):
if (not rec.hasAttribute('menu') or eval(rec.getAttribute('menu'))) and id:
keyword = str(rec.getAttribute('keyword') or 'client_action_multi')
keys = [('action',keyword),('res_model',model)]
value = 'ir.actions.wizard,'+str(id)