跳至内容
菜单
此问题已终结
3 回复
4893 查看

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

形象
丢弃