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

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

Avatar
Annuleer
Beste antwoord

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

Avatar
Annuleer
Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
feb. 24
1333
2
dec. 21
13017
0
okt. 20
4250
0
aug. 25
157
1
aug. 25
2114