From 45f3ee190950b1155bdd2de7cc2e97e065edb204 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 10 Dec 2012 16:44:11 +0100 Subject: [PATCH] [FIX] xmo@openerp.com-20121210143808-wt4jmi4x0pg85xb8 issue: don't store value from non-existent input bzr revid: xmo@openerp.com-20121210154411-vrju22fwq7gsjblm --- addons/web/static/src/js/view_form.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b13b5766aae..3d897c5d23b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2227,7 +2227,9 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we this.setupFocus(this.$('input')); }, store_dom_value: function () { - if (!this.get('effective_readonly') && this.is_syntax_valid()) { + if (!this.get('effective_readonly') + && this.$('input').length + && this.is_syntax_valid()) { this.internal_set_value( this.parse_value( this.$('input').val())); @@ -2547,7 +2549,7 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we return this._super(); }, store_dom_value: function () { - if (!this.get('effective_readonly')) { + if (!this.get('effective_readonly') && this.$('input').length) { this.internal_set_value( instance.web.parse_value( this.$textarea.val(), @@ -2720,7 +2722,7 @@ instance.web.form.FieldSelection = instance.web.form.AbstractField.extend(instan return this._super(); }, store_dom_value: function () { - if (!this.get('effective_readonly')) { + if (!this.get('effective_readonly') && this.$('input').length) { this.internal_set_value( this.values[this.$('select')[0].selectedIndex][0]); }