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

How to add image previews without using many2many or binary fields. i need to open the image when clicking on it

形象
丢弃
最佳答案

I am new to Odoo, can you tell me where to write these codes? Can I do this easily?

形象
丢弃
最佳答案

Hi,

Please try like below.

_inherit = ["image.mixin"]
_order = "sequence, id"

name = fields.Char("Name", required=True)
sequence = fields.Integer(default=10, index=True)
image_1920 = fields.Image(required=True)
related_document_id = fields.Many2one("your model", "Template", index=True, ondelete="cascade", invisible=True)
can_image_1024_be_zoomed = fields.Boolean(compute="_compute_can_image_1024_be_zoomed", store=True)
Then define a kanban view for image and add the below view for getting its preview.

For getting the preview.

https://ibb.co/kxSrxqH

Regards

形象
丢弃
相关帖文 回复 查看 活动
1
2月 24
1329
2
12月 21
13012
0
10月 20
4243
0
8月 25
146
1
8月 25
2100