Odoo Help


How do I control the size of an image being shown on the Form View by the image widget?

on 8/24/16, 9:52 AM 1,893 views

in .xml py

<field name="picture" widget="image" />

Now I want to know how shall we can control the size of  "picture";

When user upload as figure to "picture", I find the figure is too small to see clear, and I want to show it in a big size to see it clear; how shall I  do this?

On 8/25/16, 1:30 AM

Try it

<field name="picture" widget="image" class="Your_custom_class"/>
.openerp .Your_custom_class > img { 
    height: 90px; 
    width: 90px;

Revised Answer (Forget above)

    .openerp .Your_custom_class > img { height: 6000px; width: 10000px; }
    .openerp .oe_form .oe_form_field_image img { max-width:656px; max-height: 1056px; }
<field name="picture" widget="image" class="Your_custom_class"/>

thank you for your help;

I have done according to your advice as below:

1. I create a file named "im.css" in /modules/static/src/css;

2. add the below code in "im.css"

.openerp .my_image > img {

height: 90px;

width: 90px;


3. open my .xml file and edit as below:

<field name="picture" widget="image" class="my_image"/>

4. restart my odoo-server;

I find nothing changed; maybe I do something wrong?

on 8/25/16, 3:19 AM

You should connect the css to your module in xml

<template id="assets_backend" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<link rel="stylesheet" href="/modules/static/src/css.im.css"/>



Then upgrade the module.

Or try following


.openerp .my_image > img {

height: 90px;

width: 90px;



on 8/25/16, 4:05 AM

Thank you very much, Shameem PKS;

I have done it according to your guiding;

But I still have a little problem about it as below:

if I set as "height: 90px;width: 90px;", the figure is very small; and so I set it as: "height: 600px;width:800px;", the picture is bigger; and then I set ti as: "height: 6000px;width: 10000px;", I find the picture is almost the same big as before( "height: 600px;width: 800px;",); in the fact I want to the picture can be in larger size; shall I?

on 8/25/16, 4:50 AM

You can solve your problem by adding few lines

.openerp .Your_custom_class > img {

height: 6000px;

width: 10000px;


.openerp .oe_form .oe_form_field_image img {


max-height: 1056px;


It is working in odoo9.

Note that it may be effected to other image fields.

on 8/25/16, 5:38 AM

Thank you very much; it is perfect!

good job, happy life!

on 8/25/16, 8:36 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/24/16, 9:52 AM
Seen: 1893 times
Last updated: 9/15/16, 8:17 AM