Skip to Content
Menu
This question has been flagged
1 Reply
694 Views

from odoo import api, fields, models, _


class Album(models.Model):
_name = 'album.album'
_description = 'All information about album gallery'
_rec_name = 'title'
_order = 'event_start_date desc'

title = fields.Char(string="Album Name", required=True)
image = fields.Binary(string="Image", required=True, readonly=False, attachment=True)
event_start_date = fields.Date(string="Event start Date", default=fields.Date.context_today)
event_end_date = fields.Date(string="Event end Date")
note = fields.Text(string="Description")
event_image_ids = fields.One2many('album.image.images', 'image_id', string="Extra Product Media", copy=True)


class Image(models.Model):
_name = 'album.image.images'
_rec_name = 'title_1'

title_1 = fields.Char(string="Image Title")
image_1 = fields.Binary(string='Fav Pics', attachment=True)
image_id = fields.Many2one('album.album', string="Album", auto_join=True, index=True, ondelete="cascade",)


when clicking the image, i want to show the images related to it.

Thank you

Avatar
Discard
Best Answer

Hi,

You can add a new menu on the website and list all albums.

And redirect a new page for images when the user clicks on any album.

Regards,

Hemangi Rupareliya(rupareliyahemangi145@gmail.com)

Avatar
Discard