[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.
This commit is contained in:
Damien Bouvy
2016-10-05 22:31:11 +02:00
parent 780869879b
commit 4b831fb4b9
+1 -4
View File
@@ -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')