[FIX] don't screw up typing of selection values in search view

bzr revid: xmo@openerp.com-20111006095301-98cda38m1y270f3m
This commit is contained in:
Xavier Morel 2011-10-06 11:53:01 +02:00
parent 69c6913915
commit 0fc5a423e3
2 changed files with 3 additions and 3 deletions

View File

@ -779,7 +779,7 @@ openerp.web.search.SelectionField = openerp.web.search.Field.extend(/** @lends o
});
},
get_value: function () {
return this.$element.val();
return this.attrs.selection[parseInt(this.$element.val(), 10)][0];
}
});
openerp.web.search.BooleanField = openerp.web.search.SelectionField.extend(/** @lends openerp.web.search.BooleanField# */{

View File

@ -1096,10 +1096,10 @@
<t t-foreach="attrs.selection" t-as="option">
<t t-set="selected" t-value="defaults[attrs.name] === option[0]"/>
<option t-if="selected"
t-att-value="option[0]" selected="selected">
t-att-value="option_index" selected="selected">
<t t-esc="option[1]"/>
</option>
<option t-if="!selected" t-att-value="option[0]">
<option t-if="!selected" t-att-value="option_index">
<t t-esc="option[1]"/>
</option>
</t>