From f52c9fa1c0c83168634fc2d6369cc4f81087ec48 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Thu, 8 Oct 2020 09:40:45 +0000 Subject: [PATCH] [FIX] adyen_platforms: Sync KYC status on update The response we get after updating data contains the new KYC status, we then update it on the adyen account so that we don't have to wait for the cron. X-original-commit: 59fdb24527e6073cb3c4de5662d25d4d0cea08eb --- addons/adyen_platforms/models/adyen_account.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/adyen_platforms/models/adyen_account.py b/addons/adyen_platforms/models/adyen_account.py index a119bbcbf3e..ab6b3cff6b3 100644 --- a/addons/adyen_platforms/models/adyen_account.py +++ b/addons/adyen_platforms/models/adyen_account.py @@ -313,7 +313,11 @@ class AdyenAccount(models.Model): else: raise UserError(_("We had troubles reaching Adyen, please retry later or contact the support if the problem persists")) - return response.get('result') + result = response.get('result') + if 'verification' in result: + self._update_kyc_status(result['verification']) + + return result @api.model def _sync_adyen_cron(self):