From 822078d16ebec77d5e95f00e9cf16a55d1e10cf7 Mon Sep 17 00:00:00 2001 From: tbe-odoo Date: Wed, 15 Nov 2017 11:50:54 +0100 Subject: [PATCH] [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. --- addons/payment_stripe/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', '/')