How to add image previews without using many2many or binary fields. i need to open the image when clicking on it
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
5361
มุมมอง
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
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
1
ก.พ. 24
|
2568 | ||
|
Embed PDF / image preview in form view
แก้ไขแล้ว
|
|
2
ธ.ค. 21
|
14976 | |
|
|
0
ต.ค. 20
|
5555 | ||
|
|
1
มิ.ย. 26
|
2271 | ||
|
|
1
เม.ย. 26
|
2870 |