[FIX] web: allow focus to move to a field monetary

In the chart of account editor, which is an editable list with 2
contiguous monetary field, we could not change the first then move to
the second using the TAB key: the focus was not set on the input of the
second monetary field, and when it is, that input is destroyed and
recreated so the focus was lost

Before this fix, the user needed to hit TAB twice to move to the next
field.
After this fix, the user can navigate between fields monerary with TAB
This commit is contained in:
Vincent Schippefilt
2018-05-02 14:49:23 +02:00
parent 7cf68c838b
commit a017946737
2 changed files with 2 additions and 2 deletions
@@ -622,7 +622,7 @@ var FieldMonetary = InputField.extend({
this.$el.empty();
// Prepare and add the input
this._prepareInput().appendTo(this.$el);
this._prepareInput(this.$input).appendTo(this.$el);
if (this.currency) {
// Prepare and add the currency symbol
+1 -1
View File
@@ -2401,7 +2401,7 @@ QUnit.module('Views', {
// Press 'Tab' -> should go to next line
// add a value in the cell because the Tab on an empty first cell would activate the next widget in the view
list.$('.o_selected_row input').val(11).trigger('input');
list.$('.o_selected_row input').val(11).trigger('input');
list.$('.o_selected_row input').trigger({type: 'keydown', which: 9});
assert.ok(list.$('.o_data_row:nth(3)').hasClass('o_selected_row'),
"fourth row should be in edition");