diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2019-05-21 10:51:44 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2019-05-21 10:51:44 +0000 |
| commit | 8c4a88a3f92c1e7a6cd3cbbc5af5cfae3334ce60 (patch) | |
| tree | b449930e5df8b600941936984b792f74fd721df9 /addons/account/static/src | |
| parent | c7274a48e3bf62443cdfa11033de17f00062ddf6 (diff) | |
[FIX] account: auto-reconcile hidden lines
- Create 11 invoices with the same partner but different totals like:
1.0, 2.0, 3.0 ... 11.0
- Confirm them
- Create a bank statement with 11 lines having each of them the previous
invoice amount (1.0, 2.0, 3.0 .... 11.0) and the partner
- Click on the 'Reconcile' button
- In the reconcile form, do NOT push the 'Load More' button, but push
the 'Automatic Reconciliation' button
All lines are reconciled, but a JS traceback is raised.
This is because we try to destroy a widgets which were not rendered.
opw-1985580
closes odoo/odoo#33524
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/account/static/src')
| -rw-r--r-- | addons/account/static/src/js/reconciliation/reconciliation_action.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_action.js b/addons/account/static/src/js/reconciliation/reconciliation_action.js index b1b6451967f..a90d831ded1 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_action.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_action.js @@ -302,9 +302,12 @@ var StatementAction = Widget.extend(ControlPanelMixin, { 'context': self.model.getContext(), }); _.each(result.handles, function (handle) { - self._getWidget(handle).destroy(); - var index = _.findIndex(self.widgets, function (widget) {return widget.handle===handle;}); - self.widgets.splice(index, 1); + var widget = self._getWidget(handle); + if (widget) { + widget.destroy(); + var index = _.findIndex(self.widgets, function (widget) {return widget.handle===handle;}); + self.widgets.splice(index, 1); + } }); // Get number of widget and if less than constant and if there are more to laod, load until constant if (self.widgets.length < self.model.defaultDisplayQty |
