[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:
parent
ed3b0ae90b
commit
32d3c44e3e
|
@ -1605,7 +1605,7 @@ openerp.web.form.FieldSelection = openerp.web.form.Field.extend({
|
||||||
init: function(view, node) {
|
init: function(view, node) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super(view, node);
|
this._super(view, node);
|
||||||
this.values = this.field.selection;
|
this.values = _.clone(this.field.selection);
|
||||||
_.each(this.values, function(v, i) {
|
_.each(this.values, function(v, i) {
|
||||||
if (v[0] === false && v[1] === '') {
|
if (v[0] === false && v[1] === '') {
|
||||||
self.values.splice(i, 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
|
// lifted straight from r/w version
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super(view, node);
|
this._super(view, node);
|
||||||
this.values = this.field.selection;
|
this.values = _.clone(this.field.selection);
|
||||||
_.each(this.values, function(v, i) {
|
_.each(this.values, function(v, i) {
|
||||||
if (v[0] === false && v[1] === '') {
|
if (v[0] === false && v[1] === '') {
|
||||||
self.values.splice(i, 1);
|
self.values.splice(i, 1);
|
||||||
|
|
|
@ -833,7 +833,7 @@
|
||||||
<li t-if="widget.field and widget.field.selection" data-item="selection">
|
<li t-if="widget.field and widget.field.selection" data-item="selection">
|
||||||
<span class="oe_tooltip_technical_title">Selection:</span>
|
<span class="oe_tooltip_technical_title">Selection:</span>
|
||||||
<ul>
|
<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-esc="option[0]"/>]
|
||||||
<t t-if="option[1]"> - </t>
|
<t t-if="option[1]"> - </t>
|
||||||
<t t-esc="option[1]"/>
|
<t t-esc="option[1]"/>
|
||||||
|
|
Loading…
Reference in New Issue