[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.
This commit is contained in:
Rémi Rahir
2017-10-20 18:02:39 +02:00
parent 3351d2acc0
commit e9b969b39d
+1 -1
View File
@@ -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: