[FIX] usage issue of py.eval: in py.js 0.4, it returns a JS object not a PY object, so .toJSON should not be called on the result

bzr revid: xmo@openerp.com-20120327151357-4en4skjqb66b816c
This commit is contained in:
Xavier Morel 2012-03-27 17:13:57 +02:00
parent cc88233248
commit 94c7dff4ea
3 changed files with 3 additions and 3 deletions

View File

@ -1605,7 +1605,7 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({
init: function (view, node) {
this._super(view, node);
if (node.attrs.digits) {
this.digits = py.eval(node.attrs.digits).toJSON();
this.digits = py.eval(node.attrs.digits);
} else {
this.digits = view.fields_view.fields[node.attrs.name].digits;
}

View File

@ -93,7 +93,7 @@ openerp.web.page = function (openerp) {
init: function (view, node) {
this._super(view, node);
if (node.attrs.digits) {
this.digits = py.eval(node.attrs.digits).toJSON();
this.digits = py.eval(node.attrs.digits);
} else {
this.digits = view.fields_view.fields[node.attrs.name].digits;
}

View File

@ -763,7 +763,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
_(log_records.reverse()).each(function (record) {
var context = {};
if (record.context) {
try { context = py.eval(record.context).toJSON(); }
try { context = py.eval(record.context); }
catch (e) { /* TODO: what do I do now? */ }
}
$(_.str.sprintf('<li><a href="#">%s</a></li>', record.name))