Skip to Content
Menu
This question has been flagged

Add versions on the PDF name for RFQ/Sales Orders

Avatar
Discard
Author Best Answer

In order to change the PDF name of a PDF file, you have to have studio.

First, you have to add a text field on the Sale Order with studio. In this field, you will add manually the number of the version . Let´s say this new field has the technical name: x_studio_version.

Once on a sale order, go to studio > Reports Menu > Quotation/Order report. On the left hand side, you will have Studio Menu, go to Report tab and copy this code on the field Printed Report Name: 


(object.state in ('draft', 'sent') and 'Quotation - %s - %s' % (object.name, object.x_studio_version)) or 'Order - %s - %s' % (object.name, object.x_studio_version)

In the code, you will have to change the technical name to the name of the field you added on your SO. Once you print the PDF, the name will come up with the number you will have manually added on your Version field created.

If you want to also change the name of the PDF when sending email confirmation on the SO, you have to be on debug mode and be Admin. Go to Settings > Technical menu > Templates and find the one named "Sale Order: Confirmation Email" go to tab Advanced Settings and on the Report File name add this code:

${(object.state in ('draft', 'sent') and 'Q - %s %s' % (object.name, (object.x_studio_version) or '')) or 'O - %s %s' % (object.name, (object.x_studio_version) or '')}

Again, you will have to replace the x_studio_version name with the name of the field created for Version in your SO.

Avatar
Discard
Related Posts Replies Views Activity
1
May 21
2499
5
Feb 24
7341
1
Jun 21
1418
1
Apr 21
7
1
Apr 21
6120