It is currently Wed Feb 22, 2012 9:38 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Report KeyError, no service dont exist
PostPosted: Tue Jul 05, 2011 11:26 pm 
Offline

Joined: Tue Jun 21, 2011 9:37 pm
Posts: 5
Hi im having problems with a report, when i click on the link to download the report it show me this


[2011-07-05 15:18:58,474][prueba_zahha_dump] WARNING:init:Model medical.inpatient.registration is referenced but not present in the orm pool!
[2011-07-05 15:18:58,482][prueba_zahha_dump] WARNING:init:Model zahha.partner is referenced but not present in the orm pool!
[2011-07-05 15:18:58,507][prueba_zahha_dump] DEBUG:netsvc.agent:Cancel timers for prueba_zahha_dump db
[2011-07-05 15:19:10,922][prueba_zahha_dump] ERROR:service:This service does not exist: 'report.report.stockMoves'
[2011-07-05 15:19:10,923][prueba_zahha_dump] ERROR:web-services:[01]: Exception: 'report.report.stockMoves'
[2011-07-05 15:19:10,923][prueba_zahha_dump] ERROR:web-services:[02]: Traceback (most recent call last):
[2011-07-05 15:19:10,923][prueba_zahha_dump] ERROR:web-services:[03]: File "/usr/local/lib/python2.6/dist-packages/openerp-server-zahha/service/web_services.py", line 723, in go
[2011-07-05 15:19:10,924][prueba_zahha_dump] ERROR:web-services:[04]: obj = netsvc.LocalService('report.'+object)
[2011-07-05 15:19:10,924][prueba_zahha_dump] ERROR:web-services:[05]: File "/usr/local/lib/python2.6/dist-packages/openerp-server-zahha/netsvc.py", line 84, in __init__
[2011-07-05 15:19:10,924][prueba_zahha_dump] ERROR:web-services:[06]: self._service = Service._services[name]
[2011-07-05 15:19:10,924][prueba_zahha_dump] ERROR:web-services:[07]: KeyError: 'report.report.stockMoves'
[2011-07-05 15:19:10,925][prueba_zahha_dump] DEBUG:web-services:netrpc: rpc-dispatching exception
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server-zahha/service/netrpc_server.py", line 70, in run
result = self.dispatch(msg[0], msg[1], msg[2:])
File "/usr/local/lib/python2.6/dist-packages/openerp-server-zahha/netsvc.py", line 499, in dispatch
raise OpenERPDispatcherException(e, tb_s)
OpenERPDispatcherException


Here is my XML

<report
auto="False"
id="stock_moves"
model="stock.report.stock.move"
name="report.stockMoves"
rml="medical_zahha/report/stockMove.rml"
string="Movimientos"
multi="True"/>

My report py

import time
from report import report_sxw
from osv import osv

class stockMoves(report_sxw.rml_parse):
_name = 'report.medical_zahha.stockMoves'
def __init__(self, cr, uid, name, context):
super(stockMoves, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time
})
report_sxw.report_sxw('report.stockMoves',
'stock.report.stock.move',
'addons/medical_zahha/report/stockMove.rml',
parser=stockMoves)

OPENERP open a new window and show this

(<type 'exceptions.KeyError'>, KeyError('report.report.stockMoves',), <traceback object at 0x7fbf2b2b31b8>)


Top
 Profile  
 
 Post subject: Re: Report KeyError, no service dont exist
PostPosted: Wed Jul 06, 2011 6:44 pm 
Offline

Joined: Tue Jun 21, 2011 9:37 pm
Posts: 5
i solve it thanks =/


Top
 Profile  
 
 Post subject: Re: Report KeyError, no service dont exist
PostPosted: Sat Oct 15, 2011 2:29 pm 
Offline

Joined: Sat Oct 15, 2011 2:25 pm
Posts: 6
Hello,

I am new to OpenERP & getting a similar error while trying to print a report:

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

Since you have been able to solve this, please share your solutions.
Thanks.


Top
 Profile  
 
 Post subject: Re: Report KeyError, no service dont exist
PostPosted: Wed Nov 02, 2011 9:57 pm 
Offline

Joined: Tue Apr 20, 2010 6:00 pm
Posts: 9
Location: Pamplona (Spain)
The solution is in the last line:

Replace this:
report_sxw.report_sxw('report.stockMoves',
'stock.report.stock.move',
'addons/medical_zahha/report/stockMove.rml',
parser=stockMoves)

for:

report_sxw.report_sxw('report.stock.stockMoves',
'stock.report.stock.move',
'addons/medical_zahha/report/stockMove.rml',
parser=stockMoves)

You have to add the module after report.

Greetings

_________________
Ignacio Ibeas
http://www.acysos.com
Acysos S.L.


Top
 Profile  
 
 Post subject: Re: Report KeyError, no service dont exist
PostPosted: Wed Nov 09, 2011 2:28 pm 
Offline

Joined: Sat Oct 15, 2011 2:25 pm
Posts: 6
Hello iibeas,

Thanks for the response. But I am still getting an error while running my report, although a different one -
Start tag expected, \'<\' not found, line 1, column 1\n\n(<class \'lxml.etree.XMLSyntaxError\'>, XMLSyntaxError(u"Start tag expected, \'<\' not found, line 1, column 1",)

The opd_receipt.py file is -
Code:
import time
from report import report_sxw
from osv import osv

class opd_receipt(report_sxw.rml_parse):
   #_name = 'report.hospital.opd'
    def __init__(self, cr, uid, name, context):
        super(opd_receipt, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time,
        })
      
report_sxw.report_sxw('report.hospital.opd', 'hospital.opd', 'addons/hospital/report/opd_receipt.rml', parser=opd_receipt)


The hospital_report.xml file is -
Code:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
        <data>
                <report
                        id="report_hospital_print"
                        string="Print OPD"
                        model="hospital.opd"
                        name="hospital.opd"
                        rml="hospital/report/opd_receipt.rml"
                        auto="False"/>                       
        </data>
</openerp>


Am I missing something? Maybe it isn't related to this post but previously I was getting the 'key error' & then I went through a lot of posts & Launchpad for 'naming conventions', made a few changes to values in fields & now I get this error.

Any help or pointer would be really helpful. Thanks.


Top
 Profile  
 
 Post subject: Re: Report KeyError, no service dont exist
PostPosted: Thu Nov 10, 2011 9:23 am 
Offline

Joined: Sat Oct 15, 2011 2:25 pm
Posts: 6
Hello iibeas,

I have been able to successfully generate the report. The code change you suggested was definitely helpful but I committed a silly mistake. Hadn't mentioned the path of 'rml file' in Administration/Customization/Low Level Objects/Actions/Reports due to which it was giving the 'Parsing error'.

Thanks.
-------------------------------------------------------
OpenERP enthusiast @ genpro.co.in


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP