From 06746ad25b4e010d869f3ae19d07e372908fea84 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 23 Apr 2013 19:20:13 +0200 Subject: [PATCH] [FIX] note: be tolerant to unknow stages when creating users bzr revid: chs@openerp.com-20130423172013-lzi0gyo81m101fbm --- addons/note/note.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 90c2cb9bc54..eb9a6397d18 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -195,8 +195,11 @@ class res_users(osv.Model): group_id = model_id and model_id[1] or False if group_id in [x.id for x in user.groups_id]: for note_xml_id in ['note_stage_00','note_stage_01','note_stage_02','note_stage_03','note_stage_04']: - data_id = data_obj._get_id(cr, uid, 'note', note_xml_id) + try: + data_id = data_obj._get_id(cr, uid, 'note', note_xml_id) + except ValueError: + continue stage_id = data_obj.browse(cr, uid, data_id, context=context).res_id note_obj.copy(cr, uid, stage_id, default = { 'user_id': user_id}, context=context) - return user_id \ No newline at end of file + return user_id