Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
4882 Näkymät

How to upload image in custom window in form view while creating new record and viewing the image after the saving record ?

Avatar
Hylkää
Paras vastaus

In Python create Image field:-

_name = "table.name"

_columns = {

    'image': fields.binary("Image",help="This field holds the image"),

}

In XML Form view define:-

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

Avatar
Hylkää
Paras vastaus

Hi, 

Please i want to know How i can save the image in the database?

Thanks!

Avatar
Hylkää
Paras vastaus

you can use option atribute for custom preview of the image.


<field name="image" widget='image' options="{'preview_image': 'image_small', 'size': [30, 30]}"/>

Avatar
Hylkää