Merge lp:~openerp-dev/openobject-client-web/6.0-opw-4547-sma into lp:openobject-client-web

Proposed by Sananaz (Open ERP)
Status: Merged
Approved by: Xavier (Open ERP)
Approved revision: 4555
Merged at revision: 4555
Proposed branch: lp:~openerp-dev/openobject-client-web/6.0-opw-4547-sma
Merge into: lp:openobject-client-web
Diff against target: 65 lines (+17/-3)
3 files modified
addons/openerp/controllers/listgrid.py (+4/-1)
addons/openerp/static/javascript/listgrid.js (+8/-0)
addons/openerp/widgets/listgrid.py (+5/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/6.0-opw-4547-sma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+55322@code.launchpad.net

Description of the change

Hello xavier,

I am already discuss this problem with you.

In listview when records are 500/unlimited then firefox does not load the records.
Due to firefox headers issue. I have injecting cherrypy.request.terp_concurrency_info in the json responses instead of using headers for ListView.

Thank you.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/listgrid.py'
2--- addons/openerp/controllers/listgrid.py 2011-02-02 12:11:36 +0000
3+++ addons/openerp/controllers/listgrid.py 2011-03-29 11:53:27 +0000
4@@ -299,7 +299,10 @@
5
6 if frm.logs and frm.screen.view_type == 'tree':
7 server_logs = ustr(frm.logs.render())
8- return dict(ids=ids, count=count, view=view, logs=server_logs)
9+
10+ concurrency_info = getattr(cherrypy.request, 'terp_concurrency_info', None)
11+
12+ return dict(ids=ids, count=count, view=view, logs=server_logs, concurrency_info=concurrency_info)
13
14 @expose('json')
15 def button_action(self, **kw):
16
17=== modified file 'addons/openerp/static/javascript/listgrid.js'
18--- addons/openerp/static/javascript/listgrid.js 2011-02-17 12:15:43 +0000
19+++ addons/openerp/static/javascript/listgrid.js 2011-03-29 11:53:27 +0000
20@@ -33,6 +33,7 @@
21 this.__init__(name);
22 };
23
24+
25 ListView.prototype = {
26
27 __init__: function(name) {
28@@ -844,6 +845,7 @@
29 : 'arrow_up.gif'
30 )}));
31 }
32+ update_concurrency_info(obj.concurrency_info)
33 }
34 });
35 }
36@@ -924,3 +926,9 @@
37 }
38 }
39 }
40+
41+function update_concurrency_info(concurrencyInfo) {
42+ if (!concurrencyInfo)
43+ return;
44+ updateConcurrencyInfo(concurrencyInfo);
45+}
46
47=== modified file 'addons/openerp/widgets/listgrid.py'
48--- addons/openerp/widgets/listgrid.py 2011-03-16 10:03:57 +0000
49+++ addons/openerp/widgets/listgrid.py 2011-03-29 11:53:27 +0000
50@@ -182,10 +182,13 @@
51 data = proxy.read(ids, fields.keys() + ['__last_update'], ctx)
52 except:
53 pass
54-
55+
56 ConcurrencyInfo.update(self.model, data)
57+ if cherrypy.response.headers.has_key('X-Concurrency-Info'):
58+ # Delete 'X-Concurrency-Info' from header fixed firefox header problem #699960.
59+ del cherrypy.response.headers['X-Concurrency-Info']
60 self.concurrency_info = ConcurrencyInfo(self.model, ids)
61-
62+
63 order_data = [(d['id'], d) for d in data]
64 orderer = dict(zip(ids, count()))
65 ordering = sorted(order_data, key=lambda object: orderer[object[0]])