[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:
parent
6d0f31fbd1
commit
8069038a1d
|
@ -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("_");
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue