Odoo Help


This community 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.


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 248 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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