diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-11-23 12:49:23 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-11-23 12:49:23 +0100 |
| commit | 6b2b2d889c94b0cbab5fbe14a4555f4c8dbe179c (patch) | |
| tree | 6f8201364a87754347eb213bd284e2f8e9c75aa2 /addons/web/static/src | |
| parent | 709f2506ff40d799aada58df74dd78522d965868 (diff) | |
[IMP] move nonliteral domains and contexts to JS test case
bzr revid: xmo@openerp.com-20121123114923-t4047w6jztria91x
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/pyeval.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js index e16880889d2..3c6b6619513 100644 --- a/addons/web/static/src/js/pyeval.js +++ b/addons/web/static/src/js/pyeval.js @@ -602,10 +602,13 @@ openerp.web.pyeval = function (instance) { var eval_contexts = function (contexts, evaluation_context) { evaluation_context = evaluation_context || {}; return _(contexts).reduce(function (result_context, ctx) { - // TODO: wrap string contexts in nonlit? // __eval_context evaluations can lead to some of `contexts`'s // values being null, skip them as well as empty contexts if (_.isEmpty(ctx)) { return result_context; } + if (_.isString(ctx)) { + // wrap raw strings in context + ctx = { __ref: 'context', __debug: ctx }; + } var evaluated = ctx; switch(ctx.__ref) { case 'context': @@ -627,7 +630,10 @@ openerp.web.pyeval = function (instance) { var eval_domains = function (domains, evaluation_context) { var result_domain = []; _(domains).each(function (domain) { - // TODO: wrap string domains in nonlit? + if (_.isString(domain)) { + // wrap raw strings in domain + domain = { __ref: 'domain', __debug: domain }; + } switch(domain.__ref) { case 'domain': evaluation_context.context = py.dict.fromJSON(evaluation_context); @@ -650,7 +656,10 @@ openerp.web.pyeval = function (instance) { var eval_groupbys = function (contexts, evaluation_context) { var result_group = []; _(contexts).each(function (ctx) { - // TODO: wrap string contexts in nonlit? + if (_.isString(ctx)) { + // wrap raw strings in context + ctx = { __ref: 'context', __debug: ctx }; + } var group; var evaluated = ctx; switch(ctx.__ref) { |
