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 change the pdf name of a salesorder and quotation?

By
ton123
on 5/7/13, 4:16 AM 6,610 views

When I make a quotation in v6.1 with sales/sales Order and print this quotation I get a pdf with the name sales.order(xxx).pdf with xxx a sequencenumber.

I want to change the name in Qyyyyy.pdf with yyyyy=Orderreference number. This sequencenumber is SOzzz with zzz is the standard sequencenumber.

I have been looking to:

  1. settings/customization/low level objects/actions/reports and
  2. settings/configuration/Sequences & Identifiers/Sequences.

But I couldn't solve it.

How to do this?

Additional 7-5-2013 16:30 because of the answers (thank you all for them!): Yes the name document that is saved as an attachment can be manipulated.

But what I specific mean is the name of the pdf file that is direct generated from the browser like a download pdf. This is always sales.order(xxx).pdf with xxx a sequence number. This name differs from the attachement that is saved ...... ?

How to manipulate this name is the same as the attachement?

3
Shelton
On 5/7/13, 6:39 AM

You can use it like it in the invoice. The attachment attribute can be used to change the name of the file.

<report
        auto="False"
        id="account_invoices"
        model="account.invoice"
        name="account.invoice"
        rml="account/report/account_print_invoice.rml"
        string="Invoices"
        attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        attachment_use="True"
        usage="default"
        />
3

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 5/7/13, 5:10 AM

By default pdf name is updated by the string we define in <report></report> tag. Take an example suppose the report tag is like this

<report auto="False" 
        id="report_sale_order" 
        model="sale.order" name="sale.order"
        rml="sale/report/sale_order.rml" 
        string="Quotation"
        usage="default"/>

then generated pdf file will be named as Quotation.pdf & if we change the string of the report

<report auto="False" 
    id="report_sale_order" 
    model="sale.order" name="sale.order"
    rml="sale/report/sale_order.rml" 
    string="My Sale Quatation"
    usage="default"/>

Then the pdf file will be saved as My Sale Quatation.pdf

From client also you can set pdf name for that you have to change the name of report in settings/customization/low level objects/actions/reports. Change the name of the report and go to menu & open sale order there you can find changed name report.

Where to find this <report></report> tag in the menu?

ton123
on 5/7/13, 6:15 AM

See my addition on the question.

ton123
on 5/7/13, 12:30 PM

This is static name for every report same.

Yogesh
on 9/29/14, 12:39 PM
1

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 5/7/13, 7:05 AM

Here this works for me.

In settings/customization/low level objects/actions/reports, I searched Quotation / Order report, and edit it with following

In Attachments,

1) In attachment field ('Save As Attachment Prefix') put following code in textbox

('SO'+(object.name or '').replace('/',''))

  • here 'SO' is string whatever you want to print

2) attachment_use field ('Reload from Attachment') check mark True.

you will see that attachment named like 'SO0001' under the Attachments icon, click there to see the attachments. if you want to save this file to your computer just click the button “Save as” and then a window will appear, giving you the chance to keep or change the name of the .pdf file.

See my addition on the question.

ton123
on 5/7/13, 12:29 PM

you replied something else the question above.

Yogesh
on 9/29/14, 12:38 PM
0

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 10/17/16, 7:59 AM

Hi,

For v8, there is a solution, might be useful for somebody. Try this module:

https://www.odoo.com/apps/modules/8.0/report_custom_filename/

For sale order, goto Settings >> Technical >> Actions >> Reports and open the sale order report.

under Download filename, you can give ${o.name}.pdf

0
jasper
On 4/17/15, 8:04 AM

I have the same problem with Odoo 8 now. I want the number of the sales order as PDF file name. Is there any solution? 

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

2 follower(s)

Stats

Asked: 5/7/13, 4:16 AM
Seen: 6610 times
Last updated: 10/17/16, 7:59 AM