diff options
| author | wan <wan@odoo.com> | 2019-09-30 10:13:40 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-16 11:51:27 +0000 |
| commit | e00532ffb94ac9f4aed012e215d7c7adddcb7366 (patch) | |
| tree | 7b58115b7d7083e3f40a4fa6df5468af5aab50bd /addons/account/static/src/js | |
| parent | eaa094285e489dadc5607cfb9ec44fc721322a29 (diff) | |
[FIX] account: badly formatted reconciliation proposition
When a reconciliation proposition's amount is computed from a regex, we
cannnot be sure the regex captured something. If it didn't we don't want
to display a badly formatted line so we set the amount to 0.
closes odoo/odoo#38870
X-original-commit: 111495795b6cdc53312096078033804dbbfe57f2
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Diffstat (limited to 'addons/account/static/src/js')
| -rw-r--r-- | addons/account/static/src/js/reconciliation/reconciliation_model.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js index 8adb4ec1c91..d76f9941153 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_model.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js @@ -1238,11 +1238,11 @@ var StatementModel = BasicModel.extend({ break; case 'regex': var matching = line.st_line.name.match(new RegExp(values.amount_from_label_regex)) - amount = null; + amount = 0; if (matching && matching.length == 2) { matching = matching[1].replace(new RegExp('\\D' + values.decimal_separator, 'g'), ''); matching = matching.replace(values.decimal_separator, '.'); - amount = parseFloat(matching); + amount = parseFloat(matching) || 0; amount = line.balance.amount > 0 ? amount : -amount; } break; |
