Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
4896 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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" />

Аватар
Відмінити
Найкраща відповідь

Hi, 

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

Thanks!

Аватар
Відмінити
Найкраща відповідь

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


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

Аватар
Відмінити