This question has been flagged
2 Replies
2842 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)
Avatar
Discard
Best Answer

Hello,

Try with :

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

Avatar
Discard
Author

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!!

Author Best Answer

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

Avatar
Discard