Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5035 Lượt xem

How to get the URL of the PDF report (qweb report), for example    file:///C:/Users/h/Downloads/test.pdf

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello yasmina,

You can use below code for get url of the pdf report

base_url = self.env['ir.config_parameter'].get_param('web.base.url')
local_url = self.env['ir.attachment'].browse(new_created_attachment_pdf_report).mapped('local_url')
if base_url and local_url:
URL = base_url + '/'+ local_url

URL is final downloadable url for pdf type attachment created

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 23
6282
1
thg 6 23
4315
1
thg 11 22
3737
1
thg 10 21
12070
0
thg 10 21
1921