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.
lp bug: https://launchpad.net/bugs/1182101 fixed
bzr revid: xmo@openerp.com-20130624055929-3rtkgqrp4o87pvau
Custom keys from user context may be used in action contexts (not just
e.g. searchview filters). For instance, have a custom key
context_salesteam (in the user model) and an action defining some
search default as a function of the salesteam.
In that case, the action's context evaluation (view.js:~275) will blow
up.
Ensure that does not happen.
Note: eval_contexts already injects user_context in the reduction of
contexts to evaluate. It should be possible to alter the reduction
function to avoid having to inject instance.session.user_context
through pyeval.context(), maybe by _.extend-ing ``result_context``
into ``evaluation_context`` at the *top* of the reduction function
rather than at its bottom?
bzr revid: xmo@openerp.com-20130128130640-ksyvxvx6rlc4820n