Odoo Help

Welcome!

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.

0

Error while clicking to print a report

By
lewis
on 7/29/13, 10:05 AM 950 views

Hi guys!! i'm trying to print a report but i got the following error

(<type 'exceptions.KeyError'>, KeyError(u'report.reclam_report',), <traceback object at 0xaa340cc>)

here is my report xml file :

<?xml version="1.0"?>
<openerp>
        <data>
                <report
                        id="reclam"
                        string="Print Reclam..."
                        model="ownfield.claim"
                        name="reclam_report"
                        rml="reclam/report/reclam_report.rml"
                        auto="False"
                        header="False"/>
        </data>
</openerp>

and my python file :

import time
from report import report_sxw
class reclam(report_sxw.rml_parse):
          def __init__(self, cr, uid, name, context):
               super(reclam, self).__init__(cr, uid, name, context)
               self.localcontext.update({
               'time': time,
               })
report_sxw.report_sxw('report.reclam_report', 'ownfield.claim',
    'addons/reclam/report/reclam_report.rml', parser=reclam, header=True)
0

Hiral Patel (hip)

--Hiral Patel (hip)--
Tiny ERP Pvt Ltd
http://www.odoo.com
913
| 2 1 5
India
--Hiral Patel (hip)--


Hiral Patel (hip)
On 7/29/13, 10:57 AM

Hello,

Try with :

report_sxw.report_sxw('report.ownfield.claim', 'ownfield.claim','addons/reclam/report/reclam_report.rml', parser=reclam, header=True)

I've already tried it but the same error happened !! In fact, i forgot to create a "__init__.py" in the report folder . now it works very fine!! Thanks!!

lewis
on 7/29/13, 11:31 AM
0
lewis
On 7/29/13, 11:32 AM

Problem fixed by creating a "__init__.py" in the report folder !!

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

0 follower(s)

Stats

Asked: 7/29/13, 10:05 AM
Seen: 950 times
Last updated: 3/16/15, 8:10 AM