Skip to content
Snippets Groups Projects
Commit 05049ea0 authored by Loan (lse)'s avatar Loan (lse)
Browse files

[FIX] pos_adyen: JS error in loop if deleted Adyen payment line


Before this commit:
 If we remove a payment line using an Adyen payment method,
 `pending_adyen_line()` return `undefined`.
 With the `_poll_for_response` still being executed,
 it will pop some JS traceback each call with:
 ```js
 TypeError: Cannot read properties of undefined (reading 'terminalServiceId')
 ```

After this commit:
 No JS traceback loop

OPW-3032391

closes odoo/odoo#106461

X-original-commit: 52a517ca
Signed-off-by: default avatarQuentin Lejeune (qle) <qle@odoo.com>
parent 1ed5ce6f
Branches
Tags
No related merge requests found
......@@ -212,7 +212,7 @@ var PaymentAdyen = PaymentInterface.extend({
}).then(function (status) {
var notification = status.latest_response;
var order = self.pos.get_order();
var line = self.pending_adyen_line();
var line = self.pending_adyen_line() || resolve(false);
if (notification && notification.SaleToPOIResponse.MessageHeader.ServiceID == line.terminalServiceId) {
var response = notification.SaleToPOIResponse.PaymentResponse.Response;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment