Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
9032 Widoki

Hello everybody,

Now when we open an attachment, we can download the file on clicking on his link.

Is there a way to download the file directly with a button from the list? Just create a button on the list view and when we click on it, it downloads the file directly without having to open the form view then click on the link.

Thanks,

Awatar
Odrzuć
Najlepsza odpowiedź

hi Aymen,

I Have a related example with me.

Example: Need to download Perticular file in stock_picking_out tree view depend on company.

1. i need to download a file from the tree view depend on company.

create a binary field in "res.company" and from binary field select the file which u want to download.

'attachment': fields.binary("Attachmnet"),

2. create related field in stock_picking and stockpicking_out

'attachment'   : fields.related('company_id','attachment',type='binary',store=False,string="Attachmnet",readonly=True),

now we can use the attachment field in stock_picking_out tree/list view to download a file selected in res.company "attachment" binary field

Awatar
Odrzuć
Najlepsza odpowiedź

I used this in version 13. I added the field in the tree.

<field name="your_binary_file" widget="binary" readonly="1" force_save="1"/>
Awatar
Odrzuć

Thank you so much

Autor Najlepsza odpowiedź

Hi,

Thank you so much Mr. Narayanamurthy. The solution works very well.

 

Awatar
Odrzuć