Merge lp:~openerp-dev/openobject-server/trunk-bug-948158-jam into lp:openobject-server

Proposed by Jigar A.
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-server/trunk-bug-948158-jam
Merge into: lp:openobject-server
Diff against target: 26 lines (+6/-3)
1 file modified
openerp/tools/graph.py (+6/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-bug-948158-jam
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+104869@code.launchpad.net

Description of the change

Bug Fix : lp:948158 "Diagram view: bug if "source" and "destination" are inverted"
The bug description give one way to produce the bug, in-fact the diagram View which disconnected and you try to add looped edges on them you will also face same issues. The Disconnected graph should tolerate the disconnected graph and looped edges on them as well as it should also manage the cyclic instances in nodes.
The Fix will Process the disconnected nodes and put them on start y 0 position while connected nodes will be processed normally.
Kindly review this.
Thank You.

To post a comment you must log in.

Unmerged revisions

4153. By Jigar A.

Merge lp:openobject-server

4152. By Jigar A.

[FIX] graph : Totally Disconnected Daiagram view should tolerate the looped edges and also should also both graph prcess same way.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/tools/graph.py'
2--- openerp/tools/graph.py 2012-02-22 15:16:53 +0000
3+++ openerp/tools/graph.py 2012-08-29 09:19:51 +0000
4@@ -449,7 +449,8 @@
5 if self.transitions.get(child, False):
6 if last:
7 self.result[child]['y'] = last + len(self.transitions[child])/2 + 1
8- last = self.tree_order(child, last)
9+ if node!=child:
10+ last = self.tree_order(child, last)
11
12 if rest:
13 mid_node = l[no/2]
14@@ -530,8 +531,10 @@
15
16 if roots:
17 roots.append(self.start)
18- one_level_el = self.tree_list[self.start][0][1]
19- base = self.result[one_level_el]['y']# * 2 / (index + 2)
20+ base = 0
21+ if self.tree_list[self.start]:
22+ one_level_el = self.tree_list[self.start][0][1]
23+ base = self.result[one_level_el]['y']# * 2 / (index + 2)
24
25
26 no = len(roots)