This question has been flagged
1 Reply
3782 Views

I have a many2many field like this

medical_report_ids = fields.Many2many('ir.attachment', string='Medical reports')

This will accept both images and pdfs.

While displaying the data, I want to show the thumbnails for images and file name for pdf just like how it is shown in the default mail app.

I tried using <field name="medical_report_ids" widget="many2many_binary"/> but this only allows downloading attachments. I want to them to be previewed. 
Avatar
Discard

Hello Nanda, Did you find a solution?

Best Answer

You can render the file name of the pdfs while also showing thumbnails of images with the help of the following widget: . This should display thumbnails of images and the file name of the pdfs in your medical_report_ids field.

Avatar
Discard

Which widget ?