Help

8

Is it possible to open PDFs directly in the browser?

Avatar
Jason Cash

For example, when I click print on a sales quotation it downloads the pdf as a file. I would like it to open the PDF in a new tab in the web browser using a PDF web viewer plugin. This is the same action that happens when you click on a hyperlink in a webpage that points directly to a PDF file.

The reason for this is that I need to save the PDFs in a certain location with a certain name. Right now I have 50 Quotation_Order PDFs in my downloads folder.

Avatar
Discard
6 Answers
4
Avatar
haylahi
Best Answer

hello, you can do it with this module,

[Openerp Web PDF Report Preview & Print] https://github.com/buke/openerp-web-pdf-preview-print.git

3 Comments
Avatar
Discard

Does it work in ubuntu or it works in windows only?

Avatar
Shelton
-

This doesn't work with chrome in ubuntu..It throws an error get_title not defined..

Avatar
Rachid
-

not working on the version 11.0

2
Best Answer

I tried it with Google Chrome that natively deal with it and even try adding a dedicated module with no psitive result. It keeps asking to download the .pdf file. Why preview isn't natively included in OpenERP ? It seems to be a basical user need.

Avatar
Discard
1
Best Answer

I tried it with Google Chrome on MacOS that natively deals with it and even try adding a dedicated module with no positive result. It keeps asking to download the .pdf file.

But Haylahi's option worked like a charm and I can now preview Openerp pdfs in my browser.

Why PDF and other file preview isn't natively included in OpenERP ? It seems to be a basical user need.

Avatar
Discard
1
Avatar
Tim
Best Answer

I beleive this is possible with correct browser/pdf plugin settings and it has nothing to do with OpenERP

2 Comments
Avatar
Discard
Avatar
Ahmet Altinisik
-

can you show us which browser and how, (I could not managed to do that)

Avatar
James White
-

Hey Tim, I believe that this answer is incorrect. Browser will open any .pdf in browser EXCEPT in Odoo. It appears Odoo MIME is not set correctly for viewing.

1
Avatar
patrick
Best Answer

Another thought: give some naming to the PDF-files you want to save, so you can see the difference between them.

Settings -> Actions -> Reports

Click on report you want to change the default name of

in the field behind 'Save as Attachment Prefix' you can specify the name. You can use python code to specify the name. My situation:

((object.name or '!NoName')+('_')+time.strftime('%Y-%m-%d-%H-%M').replace('-','')+'.pdf')

This will use the name of the object, an _ and than the year (not century), month, day, hour and minute of the moment you pressed the print button for this object.

1 Comment
Avatar
Discard
Avatar
Shelton
-

This will not work with jasper reports, only rml reports..

0
Avatar
john
Best Answer

Firefox browser can preview the pdf with option to print or save

Avatar
Discard