← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 607692] Re: Windows gtk client crashes on charts drawing

 

** Branch linked: lp:~openerp-dev/openobject-client/trunk-dev-client

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/607692

Title:
  Windows gtk client crashes on charts drawing

Status in OpenObject GTK Client:
  Fix Released

Bug description:
  Hello.
I've posted this once, but it was refused due the bug hasn't been reproduced.
I'll try once again, describing the conditions of appearing the bug  as detailed as possible. 
Let's take a default database with demo data. In one of the production orders we shall set Repair Workhop as a workcenter(by default we have all oders  appointed to Assembly Workshop). Now let's select Reporting->Workcenter loads. Normally we should see 2 workcenters and 4 time periods. Web client displays it fine, but windows gtk client crushes:ile "widget\view\graph_gtk\graph.pyo", line 113, in display

File "tinygraph\__init__.pyo", line 123, in tinygraph
File "matplotlib\axes.pyo", line 3617, in legend
File "matplotlib\legend.pyo", line 182, in __init__
File "matplotlib\legend.pyo", line 248, in _get_handles
File "matplotlib\cbook.pyo", line 900, in safezip
ValueError: In safezip, len(args[0])=4 but len(args[1])=2 

It happens in the following code:
if len(axis_group)>1:
                axis_group = map(lambda x: x.split('/')[-1], axis_group)
                subplot.legend(gvalue2,axis_group,shadow=True,loc='best',prop = font_property)
            else:
                  t1 = [ axis_data[x]['string'] for x in axis[1:]]
                  subplot.legend(gvalue,t1,shadow=True,loc='best',prop = font_property)

The first two arguments of legend function must be of equal length, but in fact the debugger shows:
ais_group=list: ['Assembly workshop', 'Repairs workshop']     (2 items)
gvalue2=list: [<matplotlib.patches.Rectangle object at 0x0315F110>, <matplotlib.patches.Rectangle object at 0x0315FC10>, <matplotlib.patches.Rectangle object at 0x0316A6F0>, <matplotlib.patches.Rectangle obje...

(4 items)

There are 4 bars and 2 items in legend.
I removed the code that checks lenght of the arguments in safezip function of matlotlib as a temp solution and nothing bad happened, it displayed the chart.
I'm not sure how to fix it: maybe it must be gvalue instead gvalue2 in the third string?