Odoo Help


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


Report Parser Odoo 8

Samantha Cruz
on 3/6/16, 7:34 PM 390 views

I'm trying to use report parser, but it always pop an error

ValueError  The _name attribute report.test_module.report_test_doc is not valid

I searched that your report name is use for the parser _template and _name in order to be used by Odoo. It doesn't show the error if I remove the test_module in 'report.report_test_doc', but when I execute it, another error appears -  'Nonetype' object is not callable' hello()


<?xml version="1.0" encoding="utf-8"?>
            string="Monthly report of PDC"


from openerp import api, models
from openerp.report import report_sxw
import time
class report_parser(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(report_parser, self).__init__(cr, uid, name, context=context)
            'time': time,            
            'hello_world': self._hello,
    def _hello(self):
        return "Hello World!"

class report_parser_test(models.AbstractModel):
    _name = 'report.test_module.report_test_doc'
    _inherit = 'report.abstract_report'
    _template = 'test_module.report_test_doc'
    _wrapped_report_class = report_parser


<template id="report_test_doc">
    <t t-call="report.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="test_module.report_test_layout">
                <div class="page">
                    <div class="text-center">
                        <span t-esc="hello_world()"/>

What am I missing?

On 3/7/16, 3:58 AM

I have used the same code, but i didn't get any error as like as you mentioned. I had the error in "report_test_doc.xml" file. So i replaced the 6th line as below:

<t t-call="report.external_layout">

then is working fine for me. 

That was my custom layout. Anyway, it was already solved, the name of the module is the problems. Hehe Thanks anyway :)

Samantha Cruz
on 3/7/16, 7:10 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/6/16, 7:34 PM
Seen: 390 times
Last updated: 3/7/16, 3:58 AM