Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
4875 Weergaven

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

Avatar
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

Hi, 

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

Thanks!

Avatar
Annuleer
Beste antwoord

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
Annuleer