From e9b969b39daeefe092e1bee584a424929daf14b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rahir?= Date: Fri, 20 Oct 2017 17:06:20 +0200 Subject: [PATCH] [FIX[ iap: encoding of Qweb render The Qweb render method returns a strign encoded in byte. As we want to dump this into a json string in iap.charge, we need to decode it properly in UTF-8, before the dump. This problem appeared in Python3. --- 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 37f760e385e..71713dfc3fd 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 except InsufficientCreditError as e: if credit_template: arguments = json.loads(e.args[0]) - arguments['body'] = env['ir.qweb'].render(credit_template) + arguments['body'] = env['ir.qweb'].render(credit_template).decode("utf-8") e.args = (json.dumps(arguments),) raise e try: