From eff72fdd089440454ca3bcdfafa8af5d5e8b818c Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Mon, 4 Sep 2023 20:11:08 +0200 Subject: [PATCH] [IMP] account_reconcile_oca: verify data is defined --- account_reconcile_oca/models/account_bank_statement_line.py | 6 +++++- .../static/src/js/widgets/reconcile_data_widget.esm.js | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/account_reconcile_oca/models/account_bank_statement_line.py b/account_reconcile_oca/models/account_bank_statement_line.py index 673815eeca..f5e1b9daa6 100644 --- a/account_reconcile_oca/models/account_bank_statement_line.py +++ b/account_reconcile_oca/models/account_bank_statement_line.py @@ -388,7 +388,11 @@ def _compute_exchange_rate(self, data, reconcile_auxiliary_id): foreign_currency = ( self.currency_id != self.company_id.currency_id or self.foreign_currency_id - or any(line["currency_id"] != line["line_currency_id"] for line in data) + or any( + line.get("line_currency_id") + and line["currency_id"] != line["line_currency_id"] + for line in data + ) ) if not foreign_currency or self.is_reconciled: return reconcile_auxiliary_id diff --git a/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js b/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js index 0f64280bbe..65257d795d 100644 --- a/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +++ b/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js @@ -16,7 +16,9 @@ export class AccountReconcileDataWidget extends Component { this.props.record.data.currency_id[0] !== this.props.record.data.company_currency_id[0] || this.props.record.data[this.props.name].data.some( - (item) => item.line_currency_id !== item.currency_id + (item) => + item.line_currency_id && + item.line_currency_id !== item.currency_id )); } getReconcileLines() {