diff options
| author | Fabien Meghazi <fme@openerp.com> | 2011-11-24 14:46:27 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2011-11-24 14:46:27 +0100 |
| commit | 32d3c44e3edbcff4b4f06df1d72bf2ea348c02cc (patch) | |
| tree | 847046295472564b246481353945faa0622aed85 /addons | |
| parent | ed3b0ae90bd16dea869a22b28f1d619863bd4e9f (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index cb6a7bedc95..8b3f4737658 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 0200798f3d5..1fe4d028db4 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -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]"/> |
