[FIX] Replaced eval() by JSON.parse for attrs parsing in list & form.

This fixes a strange bug I was the only one to encounter.

bzr revid: fme@openerp.com-20110525090435-q1sz2rm7iydj0udl
This commit is contained in:
Fabien Meghazi 2011-05-25 11:04:35 +02:00
parent 6d0f31fbd1
commit 8069038a1d
2 changed files with 2 additions and 2 deletions

View File

@ -382,7 +382,7 @@ openerp.base.form.Widget = openerp.base.Controller.extend({
init: function(view, node) {
this.view = view;
this.node = node;
this.attrs = eval('(' + (this.node.attrs.attrs || '{}') + ')');
this.attrs = JSON.parse(this.node.attrs.attrs || '{}');
this.type = this.type || node.tag;
this.element_name = this.element_name || this.type;
this.element_id = [this.view.element_id, this.element_name, this.view.widgets_counter++].join("_");

View File

@ -175,7 +175,7 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi
field.attrs, fields[name]);
// attrs computer
if (column.attrs) {
var attrs = eval('(' + column.attrs + ')');
var attrs = JSON.parse(column.attrs);
column.attrs_for = function (fields) {
var result = {};
for (var attr in attrs) {