[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user