跳至内容
菜单
此问题已终结
1 回复
5208 查看

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?



形象
丢弃
编写者 最佳答案

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.

形象
丢弃

Hello Bill!

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

Can you give me the steps you've made?

Thanks a lot!

编写者

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.

相关帖文 回复 查看 活动
1
8月 23
4569
0
9月 24
874
0
11月 16
6489
1
9月 20
6648
1
7月 20
6013