[FIX] xmo@openerp.com-20121210143808-wt4jmi4x0pg85xb8 issue: don't store value from non-existent input

bzr revid: xmo@openerp.com-20121210154411-vrju22fwq7gsjblm
This commit is contained in:
Xavier Morel 2012-12-10 16:44:11 +01:00
parent 526c856f7e
commit 45f3ee1909
1 changed files with 5 additions and 3 deletions

View File

@ -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]);
}