Merge lp:~openerp-dev/openobject-server/6.0-bug-513746-rha into lp:openobject-server/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Rejected
Rejected by: Jay Vora (Serpent Consulting Services)
Proposed branch: lp:~openerp-dev/openobject-server/6.0-bug-513746-rha
Merge into: lp:openobject-server/6.0
Diff against target: 38 lines (+4/-5)
1 file modified
bin/report/custom.py (+4/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.0-bug-513746-rha
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+64810@code.launchpad.net

Description of the change

report: pie chart printing problem, set variable outside the loop

To post a comment you must log in.
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Rifakat,

It seems like this part of code is obsolete now, it is not being used anywhere.

Hence, I am rejecting this branch.

Thanks for the fix.

Note that similar fix has landed into 5.0

Unmerged revisions

3444. By Truong Nguyen (www.trobz.com)

[FIX] report: set variable outside the loop for resolving pie chart printing problem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/report/custom.py'
2--- bin/report/custom.py 2010-09-23 10:01:45 +0000
3+++ bin/report/custom.py 2011-06-16 12:06:34 +0000
4@@ -430,12 +430,11 @@
5 data_cum.append([k, float(data[k])+float(prev)])
6 if fields[idx+1]['cumulate']:
7 prev += data[k]
8- idx0 = 0
9 plot = line_plot.T(label=fields[idx+1]['name']+' '+str(line), data = data_cum, line_style=colors[idx0*(len(fields)-1)+idx])
10 ar.add_plot(plot)
11 abscissa.update(fields_bar[idx])
12 idx0 += 1
13-
14+
15 abscissa = map(lambda x : [x, None], abscissa)
16 ar.x_coord = category_coord.T(abscissa,0)
17 ar.draw(can)
18@@ -502,8 +501,9 @@
19
20 nb_bar = len(data_by_year)*(len(fields)-1)
21 colors = map(lambda x:fill_style.Plain(bgcolor=x), misc.choice_colors(nb_bar))
22-
23+
24 abscissa = {}
25+ idx0 = 0
26 for line in data_by_year.keys():
27 fields_bar = []
28 # sum data and save it in a list. An item for a fields
29@@ -530,8 +530,7 @@
30 data_cum.append([k, float(data[k])+float(prev)])
31 if fields[idx+1]['cumulate']:
32 prev += data[k]
33-
34- idx0 = 0
35+
36 plot = bar_plot.T(label=fields[idx+1]['name']+' '+str(line), data = data_cum, cluster=(idx0*(len(fields)-1)+idx,nb_bar), fill_style=colors[idx0*(len(fields)-1)+idx])
37 ar.add_plot(plot)
38 abscissa.update(fields_bar[idx])