0
1 Answer
0
Best Answer
Hi,
You can try this following code
attachment_id = fields.Many2one('ir.attachment', string='Attachment', help='Attachment')
def download_attachment(self):
return {
'type': 'ir.actions.act_url',
'url': '/web/image?model=ir.attachment&field=datas&id=%s&filename=%s' % (self.attachment_id.id, self.attachment_id.name),
}
Regards
2
Comments