跳至內容
選單
此問題已被標幟
10 回覆
20569 瀏覽次數

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?

頭像
捨棄
最佳答案

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?

作者

See my addition on the question.

This is static name for every report same.

最佳答案

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"
        />
頭像
捨棄
最佳答案

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.

you replied something else the question above.

最佳答案

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? 

頭像
捨棄
最佳答案

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
4月 24
1387
0
6月 21
3354
3
7月 24
2844
0
10月 24
981
1
9月 24
1489