Odoo Help


How to extend the limit to 128 characters in the field "Save as Attachment Prefix" for Reports/Invoice pdf

Michel Hugues
on 9/12/14, 5:57 AM 1,498 views

In "Settings/Technical/Actions/Reports"

Select an Edit Invoices pdf, the field "Save as Attachment Prefix" is limited to 128 characters !
How to extend it?


Rem: i use OpenErp version 7.0-20140804-231303




| 6 5 7
Tbilisi, Georgia
On 9/12/14, 7:37 AM


A fast way:

1) find a file:


2) in this file find the line, which is starts with:

        'attachment': fields.char('Save as Attachment Prefix', size=128, help='This is the filename of the attachment used to ...

3) in that line, change size=128 to greather value you like, lets say: size=256, . then save and close the file.

4) restart openerp

5) in openerp, go to: "Settings/Modules/Installed Modules" page. find there module named "Base" and open it. When you open it, you'll see two buttons: "Upgrade" and "Uninstall". clikc on "Upgrade", then wait to upgrade process to be completed.

That's all, you're done. 

However, this changes may be lost upon openerp update. the better way is to develop separated module for this purpose, inherit 'ir.actions.report.xml' class in it and override 'attachment' field thereby setting preferred size. and then install that module, instead of changing code in base module.



Also take in account that file name lengths are limited. please read "How long a file name can be?" section at: http://windows.microsoft.com/en-us/windows/file-names-extensions-faq

on 9/12/14, 7:59 AM

Thank you for your help, but mismatch ... The field is not a file name, it is an pyhon expression like this: (object.type in ('out_invoice','out_refund')) and (object.state in ('open','paid')) and ((object.number or '').replace('/','')+'.pdf')

Michel Hugues
on 9/12/14, 9:14 AM

Yes I see. Thanks for the note. As help statement says "This is the filename of ..." I thought it's just a file name. I have not gone too far into the details.

on 9/12/14, 9:37 AM
Michel Hugues
On 9/12/14, 9:08 AM


Your answer is very comprehensive.
I understand the method, I tested and it works.
I could not find alone. I also learned other things using the debug mode. Thank you very much !


About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/12/14, 5:57 AM
Seen: 1498 times
Last updated: 3/16/15, 8:10 AM