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

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лют. 24
1519
2
груд. 21
13232
0
жовт. 20
4451
3
вер. 25
2955
0
серп. 25
539