Windows gtk client crashes on charts drawing

Bug #607692 reported by vrsb
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Fix Released
Medium
OpenERP sa GTK client R&D

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?

Related branches

vrsb (shipilov555)
Changed in openobject-client:
assignee: nobody → vrsb (shepilov555)
vrsb (shipilov555)
Changed in openobject-client:
assignee: vrsb (shepilov555) → nobody
vrsb (shipilov555)
summary: - Windows gtk client crush on charts drawing
+ Windows gtk client crashes on charts drawing
Revision history for this message
vrsb (shipilov555) wrote :

Seems that gvalue2 list contains len(axis_group)*n elements since its appended in the nested loop. That's why lengh of the first and the second lgend() arguments are not equal.

Changed in openobject-client:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
Revision history for this message
Ravindra Mekhiya(OpenERP) (rme-openerp) wrote :

Hello,

I have traced out the real cause which breaks things.
On the 'Production Orders' form, if we assign 'Repairs workshop' under the 'Work Orders' tab and later when open Graph view of 'Workcenter Loads' We happen to meet the error.

Thanks.

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hi vrsb,

Thanks for the good work and the patch, but I think instead making it like this we should try out something like what I have attached in the patch.Can you try out the patch and notify So that we can fix the outstanding issue.

Thanks,

Changed in openobject-client:
status: Confirmed → In Progress
milestone: none → 6.0-rc2
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

The fix has been applied in lp:~openerp-dev/openobject-client/trunk-dev-client with revision-info as 1403 <email address hidden>. It works both on linux and windows.

Thanks,

Changed in openobject-client:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.