[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.
This commit is contained in:
tbe-odoo
2017-11-15 13:31:00 +01:00
parent 8a7426da75
commit 822078d16e
+1 -1
View File
@@ -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', '/')