Hello,
I want to create a report that is installable with a custom module I get the following error when I try to print the report.
I created it using the base_report_designer and openoffice. The copy that I uploaded to the server works fine but when I try to run the rml version which I installed using my custom module, i get the following error.
2013-05-03 05:12:01,705 25469 ERROR testDB openerp.service.web_services: Exception: u'report.faxing.fax'
Traceback (most recent call last):
File "/opt/openerp/server/openerp/service/web_services.py", line 711, in go
obj = netsvc.LocalService('report.'+object)
File "/opt/openerp/server/openerp/netsvc.py", line 99, in LocalService
return Service._services[name]
KeyError: u'report.faxing.fax'
2013-05-03 05:12:01,955 25469 ERROR testDB openerp.netsvc: report.faxing.fax
(<type 'exceptions.KeyError'>, KeyError(u'report.faxing.fax',), <traceback object at 0xb271d20c>)
Traceback (most recent call last):
File "/opt/openerp/server/openerp/netsvc.py", line 293, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/server/openerp/service/web_services.py", line 654, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/server/openerp/service/web_services.py", line 760, in exp_report_get
return self._check_report(report_id)
File "/opt/openerp/server/openerp/service/web_services.py", line 738, in _check_report
netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
File "/opt/openerp/server/openerp/netsvc.py", line 72, in abort_response
raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'report.faxing.fax', (<type 'exceptions.KeyError'>, KeyError(u'report.faxing.fax',), <traceback object at 0xb271d20c>))
here is the python code adding the report
import time
from openerp.report import report_sxw
class faxing_attach_cover(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(faxing_attach_cover, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw(
'report.faxing.fax',
'faxing.fax',
'base_report_to_fax/report/fax_report.rml',
parser=faxing_attach_cover,
header="external"
)
here is the XML i use to add the report to the server.
<openerp>
<data>
<report
auto="False"
id="faxing_faxs"
model="faxing.fax"
name="faxing.fax"
rml="base_report_to_fax/report/fax_report.rml"
string="Fax Coverpage"
attachment="(object.state in ('pending')) and ('INV'+(object.name or '').replace('/','')+'.pdf')"
attachment_use="True"
usage="default"
/>
</data>
</openerp>
What am i doing wrong?