~prontoerp/openerp-web/web-70-poe

Viewing all changes in revision 3985.

  • Committer: Xavier Morel
  • Date: 2013-06-24 05:59:29 UTC
  • Revision ID: xmo@openerp.com-20130624055929-3rtkgqrp4o87pvau
[FIX] evaluation context structures not being round-tripped through eval

JS objects are converted to py.object when passed in through the
evaluation context. py.object are not serializable by default (because
that doesn't really make sense), which breaks when the input is
intended as a dict and returned (e.g. o2m values, which are triples of
(int, int?, dict?)).

Intuitively, JS objects passed as part of the context should be mostly
JSON-ish and thus dicts, but that turns out not work work as some
addons use attribute accesses within contexts (e.g. parent.access in
account/account_invoice_view.xml)

=> Temporarily solve by converting raw js objects to an "attributed
dict" which acts as both a dict and an object and can be converted to
JSON.

Ideally, py.js should provide for a pluggable conversion, or should
use an attributed mapping internally. See issues 21 and 23.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: