Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
5375 Vues

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
Ignorer
Auteur Meilleure réponse

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
Ignorer

Hello Bill!

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

Can you give me the steps you've made?

Thanks a lot!

Auteur

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.

Publications associées Réponses Vues Activité
1
août 23
4903
0
sept. 24
1033
0
nov. 16
6690
1
sept. 20
6755
1
juil. 20
6230