Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5379 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona

Hello Bill!

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

Can you give me the steps you've made?

Thanks a lot!

Autore

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.

Post correlati Risposte Visualizzazioni Attività
1
ago 23
4906
0
set 24
1037
0
nov 16
6691
1
set 20
6758
1
lug 20
6235