[FIX] Do not alter field.selection in SelectionField. Clone the array instead.

Revert #1550: debug information should not be altered.

bzr revid: fme@openerp.com-20111124134627-mx3k2s22naht07go
This commit is contained in:
Fabien Meghazi 2011-11-24 14:46:27 +01:00
parent ed3b0ae90b
commit 32d3c44e3e
2 changed files with 3 additions and 3 deletions

View File

@ -1605,7 +1605,7 @@ openerp.web.form.FieldSelection = openerp.web.form.Field.extend({
init: function(view, node) {
var self = this;
this._super(view, node);
this.values = this.field.selection;
this.values = _.clone(this.field.selection);
_.each(this.values, function(v, i) {
if (v[0] === false && v[1] === '') {
self.values.splice(i, 1);
@ -3121,7 +3121,7 @@ openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend(
// lifted straight from r/w version
var self = this;
this._super(view, node);
this.values = this.field.selection;
this.values = _.clone(this.field.selection);
_.each(this.values, function(v, i) {
if (v[0] === false && v[1] === '') {
self.values.splice(i, 1);

View File

@ -833,7 +833,7 @@
<li t-if="widget.field and widget.field.selection" data-item="selection">
<span class="oe_tooltip_technical_title">Selection:</span>
<ul>
<li t-foreach="widget.field.selection" t-as="option" t-if="option[0]">
<li t-foreach="widget.field.selection" t-as="option">
[<t t-esc="option[0]"/>]
<t t-if="option[1]"> - </t>
<t t-esc="option[1]"/>