Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to give custom name to pdf file with Qweb XML Report in Odoo v8?

By
Andre Leander
on 10/12/14, 9:40 PM 1,266 views

Hello guys.. I have tried using 'attachment' field to give name for pdf file with Qweb XML. but it do not work. I have seen an example from account invoice : attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')". When I generate the invoice to pdf, it is still using 'account.report_invoice.pdf' for pdf file name, where it came from 'name' or 'report_name' of report object field.

Thank u guys for your best help..

Idem for me! Did you solve this problem?

Pascal Tremblay
on 12/4/14, 8:03 AM

@Pascal Temblay: Yeah I have solve this problem with create my own report module. If you look at report/controller/main.py, u will find that name of file always reportname.pdf (report.report_name).

Andre Leander
on 12/5/14, 12:30 AM
0
Bogdan Hurezeanu
On 11/7/16, 5:07 PM

Well, i have a similar issue. Installed the attachments app and i have seen there are two reports generated. One with the prefix set by me and one with initial setup.


The bothering thing is that i get the one with  basic filename (Quotation Order.pdf)

0
Andre Leander
On 12/5/14, 12:42 AM

@zbik: I don't think so bro.. Odoo allows the developers to customize what have built. It just lack on technical documentation. I have solve this problem with create my report route and controller.

0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/4/14, 11:12 AM

Odoo is stupid in this area. Attachment and his name is not the same as the name of the invoice by clicking on "Print".

If you install module "Document Management System" you get an extra button "Attachment(s)", on invoice view, where, on list, you see  right and expected attachment name. An attachment is also a pdf file.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 10/12/14, 9:40 PM
Seen: 1266 times
Last updated: 11/7/16, 5:07 PM