Skip to Content
Menu
This question has been flagged
1 Reply
5147 Views

In Odoo V11 CE, the pdf_viewer widget displays a field that is about one third of the full height of an A4 pdf by default. 

The field is scrollable, but it would be great to be able to display the whole pdf and not have to scroll back and forth within the small field window without having to resort to full screen mode.

Is there any way to increase the height of such a field?



Avatar
Discard
Author Best Answer

I found the file where it can be changed here:


/home/odoo/odoo-server/addons/mrp/static/src/less/mrp.less


The default height is 450px, but I set it to 1100px and that fits a whole A4 pdf in the window pretty much.

Avatar
Discard

Hello Bill!

I'm curious about how you've done this.

Can you give me the steps you've made?

Thanks a lot!

Author

Hi Mark.

Well, you just have to find the file on your server and edit it, then restart the server. Here's a link showing the code in the less file for V11 on Odoo's github repositry.

https://github.com/odoo/odoo/blob/11.0/addons/mrp/static/src/less/mrp.less

It's not a large file and it's easy to see the height setting at 450px.

You just change that value to something appropriate (I actually ended up at 1200px I think). Just remember that the change will be overwritten if you update the source code in the future and you'll have to re-edit it again. There are probably more permanent, better-practice ways of doing it but they would be beyond my knowledge.

If you're not sure how to do things like navigate the directories and files in your Odoo installation, and stop and restart the server, then there's probably a lot more research you need to do before messing around with the source code. You can probably cause a lot of problems for yourself if you're not careful.

Thanks a lot Bill!

Though, I encountered a problem with less so I changed into scss file, and create my own XML and JS to override the assets_backend.

Related Posts Replies Views Activity
1
Aug 23
4484
0
Sep 24
830
0
Nov 16
6360
1
Sep 20
6587
1
Jul 20
5953