Odoo Help


I add image in treeview but not show image,show image type binary ?

Huynh Huu Tho
on 1/13/14, 4:48 AM 2,511 views

Hi all,

This is code :


<record id="product_category_tree_view" model="ir.ui.view">

       <field name="name">product.category.tree</field>

        <field name="model">product.category</field>

        <field name="field_parent">child_id</field>

        <field name="arch" type="xml">

            <tree toolbar="True" string="Product Categories">

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

                <field name="name"/>




field image in class product_category()

'image': fields.binary("Image",help="This field holds the image used as image for the product, limited to 1024x1024px."),

"file product.js"

openerp.product = function(instance) {


    _format: function (row_data, options) {

        var placeholder = "/web/static/src/img/placeholder.png";

        var value = row_data[this.id].value;

        var img_url = placeholder;

        if (value && value.substr(0, 10).indexOf(' ') == -1) {

            img_url = "data:image/png;base64," + value;

        } else {

            img_url = instance.session.url('/web/binary/image', {model: options.model, field: this.id, id: options.id});


        return _.template('<image src="<%-src%>" width="80px"/>', {

            src: img_url





when I click on the "Products by Category", then it does:

this is show


jdhdkjashdkashdkashdkas______ l__________ Category 1

jhskjdahsdkashkdashkkadjkas __l __________Category 2

i want colum image show image thumb ?

On 1/13/14, 8:48 AM

Can add image in list view with the link


Med Said BARA
On 2/15/14, 3:16 PM

Try this module: listview_images

How use it

Jhon Felipe Urrego Mejia
on 4/3/14, 5:16 PM

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: 1/13/14, 4:48 AM
Seen: 2511 times
Last updated: 3/16/15, 8:10 AM