From 2a3adac9333c2bd5cb9f0dca3ba080cd3e6dfce8 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 3 Jan 2025 11:31:46 +0700 Subject: automatic download --- indoteknik_custom/models/coretax_fatur.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index 1c3af6a4..a0820fee 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -85,9 +85,10 @@ class CoretaxFaktur(models.Model): }) # Kembalikan URL untuk download dengan header 'Content-Disposition' - return { + response = { 'type': 'ir.actions.act_url', - 'url': '/web/content/{}'.format(attachment.id), + 'url': '/web/content/{}?download=true'.format(attachment.id), 'target': 'self', - 'params': {'download': True}, # Menambahkan parameter untuk memastikan file didownload } + + return response -- cgit v1.2.3