[FIX] website_sale: allow public user to print cart
When the public user is connected, allow him to print the report of the open cart. Since 61b4b6777d64 the sudo is not enough but with_user(1) is required. closes odoo/odoo#80803 X-original-commit: a4021965f1f049c69186e1f2acbc55ae59ee8730 Signed-off-by: Olivier Dony <odo@odoo.com>
This commit is contained in:
@@ -1103,7 +1103,7 @@ class WebsiteSale(http.Controller):
|
||||
def print_saleorder(self, **kwargs):
|
||||
sale_order_id = request.session.get('sale_last_order_id')
|
||||
if sale_order_id:
|
||||
pdf, _ = request.env.ref('sale.action_report_saleorder').sudo()._render_qweb_pdf([sale_order_id])
|
||||
pdf, _ = request.env.ref('sale.action_report_saleorder').with_user(SUPERUSER_ID)._render_qweb_pdf([sale_order_id])
|
||||
pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', u'%s' % len(pdf))]
|
||||
return request.make_response(pdf, headers=pdfhttpheaders)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user