How to add image previews without using many2many or binary fields. i need to open the image when clicking on it
Esta pergunta foi sinalizada
2
Respostas
5354
Visualizações
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
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscrever-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
|
1
fev. 24
|
2567 | ||
|
Embed PDF / image preview in form view
Resolvido
|
|
2
dez. 21
|
14972 | |
|
|
0
out. 20
|
5554 | ||
|
|
1
jun. 26
|
2266 | ||
|
|
1
abr. 26
|
2860 |