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
=== modified file 'openerp/workflow/wkf_expr.py'
--- openerp/workflow/wkf_expr.py 2011-09-14 10:25:05 +0000
+++ openerp/workflow/wkf_expr.py 2012-11-28 15:22:22 +0000
@@ -46,6 +46,8 @@
46 assert action, 'You used a NULL action in a workflow, use dummy node instead.'46 assert action, 'You used a NULL action in a workflow, use dummy node instead.'
47 for line in action.split('\n'):47 for line in action.split('\n'):
48 line = line.strip()48 line = line.strip()
49 if not line:
50 continue
49 uid=ident[0]51 uid=ident[0]
50 model=ident[1]52 model=ident[1]
51 ids=[ident[2]]53 ids=[ident[2]]