Merge lp:~openerp-dev/openobject-server/trunk-bug-1035976-tpa into lp:openobject-server

Proposed by Turkesh Patel (openERP)
Status: Merged
Merged at revision: 4609
Proposed branch: lp:~openerp-dev/openobject-server/trunk-bug-1035976-tpa
Merge into: lp:openobject-server
Diff against target: 12 lines (+2/-0)
1 file modified
openerp/workflow/wkf_expr.py (+2/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-bug-1035976-tpa
Reviewer Review Type Date Requested Status
Vo Minh Thu (community) Needs Fixing
Review via email: mp+122837@code.launchpad.net

Description of the change

[FIX] Workflow function activities explode if they contain empty lines.

To post a comment you must log in.
Revision history for this message
Vo Minh Thu (thu) wrote :

You can call continue after the line=line.strip() when the line is empty, so it would even work for blank lines.

review: Needs Fixing
Revision history for this message
Vo Minh Thu (thu) wrote :

B.t.w. I think you can use filter(None, action.split('\n') (i.e. None instead of the lambda).

Revision history for this message
Turkesh Patel (openERP) (turkesh-tinyerp) wrote :

Improved code as per your last comment.

4396. By Vo Minh Thu

[IMP] wkf_expr: Ignore empty lines and lines with blanks.

4397. By Vo Minh Thu

[MERGE] merged trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/workflow/wkf_expr.py'
2--- openerp/workflow/wkf_expr.py 2011-09-14 10:25:05 +0000
3+++ openerp/workflow/wkf_expr.py 2012-11-28 15:22:22 +0000
4@@ -46,6 +46,8 @@
5 assert action, 'You used a NULL action in a workflow, use dummy node instead.'
6 for line in action.split('\n'):
7 line = line.strip()
8+ if not line:
9+ continue
10 uid=ident[0]
11 model=ident[1]
12 ids=[ident[2]]