diff options
| author | Numerigraphe - Lionel Sausin <ls@numerigraphe.fr> | 2010-11-12 15:10:41 +0100 |
|---|---|---|
| committer | Numerigraphe - Lionel Sausin <ls@numerigraphe.fr> | 2010-11-12 15:10:41 +0100 |
| commit | 182cf2b196da0d1f55ddfdcff62058b423e1bbc0 (patch) | |
| tree | 779b50e2e54b1624ba669b4a3f56bb6407c08d49 /bin/workflow | |
| parent | e013734045bbaae906748a8026455bac6786568e (diff) | |
| parent | cc0d270bab0d0b7862430c3e527f7edc02d1d587 (diff) | |
[MERGE] sync with the trunk
bzr revid: ls@numerigraphe.fr-20101112141041-19kpvr7pzxqankqo
Diffstat (limited to 'bin/workflow')
| -rw-r--r-- | bin/workflow/wkf_expr.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/workflow/wkf_expr.py b/bin/workflow/wkf_expr.py index 0150105c3ab..71a15a181f9 100644 --- a/bin/workflow/wkf_expr.py +++ b/bin/workflow/wkf_expr.py @@ -68,17 +68,17 @@ def execute(cr, ident, workitem, activity): return _eval_expr(cr, ident, workitem, activity['action']) def check(cr, workitem, ident, transition, signal): - ok = True - if transition['signal']: - ok = (signal==transition['signal']) + if transition['signal'] and signal != transition['signal']: + return False uid = ident[0] - if transition['role_id'] and uid != 1: + if transition['group_id'] and uid != 1: pool = pooler.get_pool(cr.dbname) - user_roles = pool.get('res.users').read(cr, uid, [uid], ['roles_id'])[0]['roles_id'] - ok = ok and pool.get('res.roles').check(cr, uid, user_roles, transition['role_id']) - ok = ok and _eval_expr(cr, ident, workitem, transition['condition']) - return ok + user_groups = pool.get('res.users').read(cr, uid, [uid], ['groups_id'])[0]['groups_id'] + if not transition['group_id'] in user_groups: + return False + + return _eval_expr(cr, ident, workitem, transition['condition']) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
