diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-08-24 16:20:29 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2017-08-24 16:20:29 +0200 |
| commit | ea60ec029d48daf3453bac5ed5752cf5ca3b37ee (patch) | |
| tree | 8e36fa1569ba495ac78feaebe3a74d22149dda9e | |
| parent | c0247e6a8d6057710908be941dec6a846c31cd28 (diff) | |
[FIX] account: traceback in reconciliation widget
If a user reconcile an active line, when he active an other line, the
widget can't close the removed line because it no longer exists.
bug introduce by https://github.com/odoo/odoo/commit/1de418aa7afb986eeb2b98f12dee0c5661902737
| -rw-r--r-- | addons/account/static/src/js/reconciliation/reconciliation_action.js | 5 | ||||
| -rw-r--r-- | addons/account/static/tests/reconciliation_tests.js | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_action.js b/addons/account/static/src/js/reconciliation/reconciliation_action.js index 8763d5acaa1..fabfee1ad00 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_action.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_action.js @@ -201,7 +201,10 @@ var StatementAction = Widget.extend(ControlPanelMixin, { _.each(self.model.lines, function (line, _handle) { if (line.mode !== 'inactive' && _handle !== handle) { self.model.changeMode(_handle, 'inactive'); - self._getWidget(_handle).update(line); + var widget = self._getWidget(_handle); + if (widget) { + widget.update(line); + } } }); } diff --git a/addons/account/static/tests/reconciliation_tests.js b/addons/account/static/tests/reconciliation_tests.js index 511656906d9..d90ceb08d4c 100644 --- a/addons/account/static/tests/reconciliation_tests.js +++ b/addons/account/static/tests/reconciliation_tests.js @@ -1005,7 +1005,6 @@ QUnit.module('account', { clientAction.destroy(); }); - QUnit.test('Reconciliation pager', function (assert) { assert.expect(6); @@ -1219,9 +1218,11 @@ QUnit.module('account', { assert.strictEqual(clientAction.$('.o_reconciliation_line').length, 10, "should display 10 lines"); assert.strictEqual(clientAction.$('.js_load_more:visible').length, 1, "should display the load more button"); + clientAction.$('.accounting_view:has(.o_reconcile:visible) thead .cell_action').click(); clientAction.$('.o_reconcile:visible').click(); assert.strictEqual(clientAction.$('.o_reconcile:visible').length, 0, "should remove the reconciled line"); assert.strictEqual(clientAction.$('.o_reconciliation_line').length, 10, "should load one line to complete the 10"); + clientAction.$('thead .cell_action:eq(1)').click(); clientAction.$('.js_load_more').click(); assert.strictEqual(clientAction.$('.o_reconciliation_line').length, 11, "should load the last record"); assert.strictEqual(clientAction.$('.js_load_more:visible').length, 0, "should hide the load more button"); |
