From ee73f6a0285a0e3f272355bd1d51bb121d51ab0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Rahir?= <rar@odoo.com>
Date: Tue, 10 Oct 2017 16:33:50 +0200
Subject: [PATCH] [FIX] iap: fix charge helper

InsufficientCreditError was not properly raised, thus not caught by the JS.
---
 addons/iap/models/iap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/iap/models/iap.py b/addons/iap/models/iap.py
index 9739a560dd1c..d688a95c702d 100644
--- a/addons/iap/models/iap.py
+++ b/addons/iap/models/iap.py
@@ -95,7 +95,7 @@ def charge(env, key, account_token, credit, description=None, credit_template=No
             arguments = json.loads(e.args[0])
             arguments['body'] = env['ir.qweb'].render(credit_template)
             e.args = (json.dumps(arguments),)
-
+        raise e
     try:
         yield
     except Exception as e:
-- 
GitLab