From 00997c93a9cc3a3fcb3cfd7f63fd747251978a9e Mon Sep 17 00:00:00 2001 From: Parth Choksi Date: Tue, 14 May 2019 06:38:29 +0000 Subject: [FIX] web: pdf file not previewed The pdf_viewer widget fails to load file and hence shows error. This is due to the wrong controller called(wrong URI passed), while loading a file using pdfjs. For files other than images, /web/content controller should be called since since odoo/odoo#31811. This is similar to the enterprise fix 793c76298a2b301a2 task-1932190 closes odoo/odoo#33354 Signed-off-by: Simon Lejeune (sle) --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index f4a518e28ea..2e17dee139f 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1729,7 +1729,7 @@ var FieldPdfViewer = FieldBinaryFile.extend({ id: this.res_id, }; var queryString = $.param(queryObj); - fileURI = '/web/image?' + queryString + fileURI = '/web/content?' + queryString; } fileURI = encodeURIComponent(fileURI); var viewerURL = '/web/static/lib/pdfjs/web/viewer.html?file='; -- cgit v1.2.3