Basic JSON-RPC support

Bug #1196243 reported by Georges Racinet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
anybox.funkload.openerp
Fix Released
Undecided
Unassigned

Bug Description

JSON-RPC has been the standard communication layer between the javascript web client and the server since 6.1
Henceforth, it provides a data path closer to what an end user might experience, and OpenERP builtin or addon controllers APIs are good candidates for functionnal testing / benching.

Besides, and that's the main reason why Anybox needs this right now, 64 bits integers can be transported over JSON-RPC, whereas the server's xmlrpclib won't emit them (see http://bugs.python.org/issue2985)

Related branches

Revision history for this message
Georges Racinet (gracinet) wrote :

Quick from scratch implementation done and works for the test case I'm currently working on.
No documentation yet.

Should probably be reworked to rely on a funkload-level facility (submit it if necessary upstream) and/or be rewritten with the json-rpc python library instead of direct post.

Kudos to vaab for the wrap-up (https://github.com/vaab/js-oe-json)

summary: - Basis JSON-RPC support
+ Basic JSON-RPC support
Changed in anybox.funkload.openerp:
status: New → Fix Committed
Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

did you check http://bazaar.launchpad.net/~openerp/openerp-web/trunk/view/head:/addons/web/http.py#L1141

We plan to move http.py to the server. Exact /jsonrpc marshmalling might change.

Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

And actually only 53 bits int are supported. There also might be problems when dict using non str keys are used (like ints) as json only support unicode string keys in dicts.

Revision history for this message
Georges Racinet (gracinet) wrote :

Thanks for the tips, Anthony.

Indeed this implementation is for the 7.0 branch, I did not check current trunk yet (benching a 7.0 project), but that shouldn't be hard to adapt for future stable versions.

About those 53 bits, I'm a bit surprised. Is that a limitation of the server, of the protocol, of some library ?

PostgreSQL bigints are 64 bits (8-bytes), so it'd made sense to support them if possible (anyway, anything relying on the current xmlrpclib can't go beyond 32 bits)
In the case I care about, I can restrict to 53 bits.

Cheers,

Revision history for this message
Georges Racinet (gracinet) wrote :

Released with 0.2.
The limitation wrt future OpenERP version has been made explicit in doc

Changed in anybox.funkload.openerp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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