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

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

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

Autor

See my addition on the question.

This is static name for every report same.

Najlepsza odpowiedź

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"
        />
Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

See my addition on the question.

you replied something else the question above.

Najlepsza odpowiedź

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? 

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 24
1413
0
cze 21
3374
3
lip 24
2889
0
paź 24
1006
1
wrz 24
1523