How to add image previews without using many2many or binary fields. i need to open the image when clicking on it
This question has been flagged
2
Respostes
4789
Vistes
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"]Then define a kanban view for image and add the below view for getting its preview.
_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)
For getting the preview.
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se| Related Posts | Respostes | Vistes | Activitat | |
|---|---|---|---|---|
|
|
1
de febr. 24
|
2114 | ||
|
|
2
de des. 21
|
14307 | ||
|
|
0
d’oct. 20
|
5111 | ||
|
|
1
de des. 25
|
785 | ||
|
|
3
de set. 25
|
4093 |