Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4885 Visualizzazioni

I have an one2many field imaged_ids, I am able to download images one by one using the following:

return {
'type': 'ir.actions.act_url',
'target': 'current',
'url': "web/content/?model=ir.attachment&id=" + str(attachment_id.id) + "&download=true&filename=" + attachment_id.name,
}

Now I need to show a button and download all images in a single click, is it possible? Can someone help me ut of this?

Thanks for the the help in advance.

Avatar
Abbandona
Autore Risposta migliore

I have solved the issue for now with a solution like in  javascript :

result.forEach(function(attachment) {
console.log(attachment);
var url = "web/content/?model=ir.attachment&id=" + attachment.id + "&download=true&filename=" + attachment.name;
window.open(url, '_blank');
});

Unless any other more effective solution comes up for this, I will continue with the above solution.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mar 22
1738
1
nov 23
8445
0
mag 22
45
1
gen 21
3624
1
mag 21
4870