Odoo Help


file field in the <report /> xml file

Andrea Alessandrini
on 8/12/17, 2:03 PM 807 views

In odooV8, I don't understand the "file" field in the xml <report declaration (where report is the shortcut for ir.action.report).

For instance, with: 


      id="contract_fibra_30 "

      string="Contract fibra 30 Mb/s"






id  is the unique name of the action.report declaration

string is the human readable name of the action.report declaration 

name is the template name is used for the report

model is the model used to get the data

report_type is the pdf or html type

file ???

Is not the name of the downloaded file.


Andrea Alessandrini
On 8/18/17, 9:06 AM

Thanks Axel,

if I set 


I have got this error 

            ValueError: "name 'contract_fibra_30Mb' is not defined" while evaluating


I think because I have to declare the name as a string, like this: 

attachment=" 'contract_fibra_30Mb.pdf' "     or

attachment=" 'contract_fibra_30Mb' + '.pdf' "     


Anyway, even in the second type of declaration, the output pdf still doesn't take the right name,ç

but still has this name: "contract_fibra_print.contract_f_30.pdf" 


Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
On 8/13/17, 12:07 AM

Hi Andrea Alessandrini

The file attribute of the report definition tag it used to save it's value for the field report_rml of the model ir.actions.report.xml that have the following definition were you could read it's help

'report_rml': fields.char('Main Report File Path/controller', help="The path to the main report file/controller (depending on Report Type) or NULL if the content is in another data field"),

so it's not intended to be used with qweb reports since it will not be used at all.

To specify the report filename to be generated you need to use the attachment attribute that it will end in the attachment field of the same model that have the following definition:

'attachment': fields.char('Save as Attachment Prefix', help='This is the filename of the attachment used to store the printing result. Keep empty to not save the printed reports. You can use a python expression with the object and time variables.'),

Hope this helps

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: 8/12/17, 2:03 PM
Seen: 807 times
Last updated: 8/18/17, 9:06 AM