[FIX] account: manual reconciliation open the first line when validate

the opening is done even when there is still an open line
This commit is contained in:
Christophe Matthieu
2018-01-12 14:28:45 +01:00
parent d0a545df78
commit 05fe5384fe
2 changed files with 9 additions and 2 deletions
@@ -359,7 +359,11 @@ var ManualAction = StatementAction.extend({
title: self.title,
time: Date.now()-self.time,
});
self._openFirstLine();
if(!_.any(result.updated, function (handle) {
return self.model.getLine(handle).mode !== 'inactive';
})) {
self._openFirstLine();
}
});
},
});
@@ -1144,7 +1144,7 @@ QUnit.module('account', {
});
QUnit.test('Reconciliation manual', function (assert) {
assert.expect(12);
assert.expect(13);
var clientAction = new ReconciliationClientAction.ManualAction(null, this.params.options);
@@ -1182,6 +1182,9 @@ QUnit.module('account', {
assert.strictEqual(clientAction.$('.o_reconciliation_line:eq(1) .o_reconcile:visible').length, 1, "should display 'Reconcile' button in green");
clientAction.$('.o_reconciliation_line:eq(1) .o_reconcile:visible').trigger('click');
assert.strictEqual(clientAction.$('.o_reconciliation_line[data-mode!="inactive"]').length, 1, "should have only one line open");
clientAction.$('.o_reconciliation_line:eq(1) [data-line-id="23"] .cell_label').trigger('click');
clientAction.$('.o_reconciliation_line:eq(1) [data-line-id="24"] .cell_label').trigger('click');