From 4b831fb4b91694d8cecbd2ec1be14ad6108d54d7 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Wed, 5 Oct 2016 22:20:37 +0200 Subject: [PATCH] [FIX] website_quote: browse acquirer with sudo in all cases Somehow in the migration to the new api, it was decided that the acquirers would be browser as sudo only for token access. This caused portal users to have a crash when trying to view their quotation since some fields from acquirers are set the specific groups for security. This commit reintroduces the old behaviour, which was to browse as SUPERUSER in all cases for the rendering of the buttons. --- addons/website_quote/controllers/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index 10518e58ea3..0fcb9485d76 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -59,10 +59,7 @@ class sale_quote(http.Controller): } if Order.require_payment or values['need_payment']: - if token: - values['acquirers'] = list(request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', Order.company_id.id)])) - else: - values['acquirers'] = list(request.env['payment.acquirer'].sudo(user=request.uid).search([('website_published', '=', True), ('company_id', '=', Order.company_id.id)])) + values['acquirers'] = list(request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', Order.company_id.id)])) extra_context = { 'submit_class': 'btn btn-primary', 'submit_txt': _('Pay & Confirm')