diff options
| author | Christophe Simonis <chs@openerp.com> | 2013-04-23 19:20:13 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2013-04-23 19:20:13 +0200 |
| commit | 06746ad25b4e010d869f3ae19d07e372908fea84 (patch) | |
| tree | 3fd8e23539e93d27f51e08f99462f6ed7f98695a /addons/note/note.py | |
| parent | 1e344dbc538d46e94744e983fbb0a5449186b4a4 (diff) | |
[FIX] note: be tolerant to unknow stages when creating users
bzr revid: chs@openerp.com-20130423172013-lzi0gyo81m101fbm
Diffstat (limited to 'addons/note/note.py')
| -rw-r--r-- | addons/note/note.py | 7 |
1 files 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 |
