summaryrefslogtreecommitdiff
path: root/addons/payment_stripe/controllers
diff options
context:
space:
mode:
authortbe-odoo <tbe@odoo.com>2017-11-15 11:50:54 +0100
committertbe-odoo <tbe@odoo.com>2017-11-15 13:31:00 +0100
commit822078d16ebec77d5e95f00e9cf16a55d1e10cf7 (patch)
tree54056d6b9cad334a56fd5f1249862c9bf3caa430 /addons/payment_stripe/controllers
parent8a7426da753da0fbc580c8f52d298a4c168dbf45 (diff)
[FIX] stripe: Fix crash when using language not defined
- This commit, fixes a crash triggered when the user is paying a quote while having his browser language set to a language not defined on the Odoo database. This is due to the fact that the field 'name' on the model 'account.analytic.account' is translatable. Stripe sends a json query to the server with the user's browser's language on the 'Accept-Language' http header field. By doing this, Odoo add a 'lang' key to the context, which is then used to translate translatable fields.
Diffstat (limited to 'addons/payment_stripe/controllers')
-rw-r--r--addons/payment_stripe/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment_stripe/controllers/main.py b/addons/payment_stripe/controllers/main.py
index b4627157a9e..356f36cf101 100644
--- a/addons/payment_stripe/controllers/main.py
+++ b/addons/payment_stripe/controllers/main.py
@@ -35,5 +35,5 @@ class StripeController(http.Controller):
response = tx._create_stripe_charge(tokenid=post['tokenid'], email=post['email'])
_logger.info('Stripe: entering form_feedback with post data %s', pprint.pformat(response))
if response:
- request.env['payment.transaction'].sudo().form_feedback(response, 'stripe')
+ request.env['payment.transaction'].sudo().with_context(lang=None).form_feedback(response, 'stripe')
return post.pop('return_url', '/')