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