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 in custom report ?

By
CHEBBAKI kader
on 11/5/14, 5:57 PM 998 views

Hi,

I have an error when launching custom report :

in report.xml

 

<report
            auto="False"
            id="facture"
            model="account.invoice"
            name="facture"
            rml="account_invoice_layout/report/account_print_invoice_fr.rml"
            string="Facture"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"/>

 

in report/account_print_invoice_fr.py

report_sxw.report_sxw('report.facture', 'account.invoice', 'addons/account_invoice_layout/report/account_print_invoice_fr.rml', parser=account_print_invoice_fr, header="internal")

when i run the report i have his error :

2014-11-05 22:56:24,165 2660 ERROR myDB openerp.service.web_services: Exception: u'report.facture'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 711, in go
    obj = netsvc.LocalService('report.'+object)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 98, in LocalService
    return Service._services[name]
KeyError: u'report.facture'
2014-11-05 22:56:24,414 2660 ERROR myDB openerp.netsvc: report.facture
(<type 'exceptions.KeyError'>, KeyError(u'report.facture',), <traceback object at 0xd137acc>)

my __init__.py contains :

import account_print_invoice_fr

any help ?

thanks a lot

0

Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
http://www.odoo.com
5975
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 11/7/14, 12:17 AM

Hi,

report_sxw.report_sxw('report.facture', 'account.invoice', 'addons/account_invoice_layout/report/account_print_invoice_fr.rml', parser=account_print_invoice_fr, header="internal")

In this line you have to assign the class name in "parse" parameter. Can you confirm this ?

There may be the case that you have not given your report.xml into __openerp__.py file.

Is there any thing else then let us know. And give us the exact and entire trace log.

0
CHEBBAKI kader
On 11/7/14, 6:09 AM

Hi,

The class parser is 

class account_print_invoice_fr(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(account_print_invoice_fr, self).__init__(cr, uid, name, context=context)
        self.cr = cr
        self.uid = uid
        self.pool = pooler.get_pool(self.cr.dbname)
        self.localcontext.update({
            'time': time,
            'invoice_lines_layout': self._invoice_lines_layout,
        })
        self.context = context

The __openerp__.py file contains the reference to report.xml:

'data': [
        'account_invoice_layout_view.xml',
        'invoice_report.xml',
    ],

i see that the _init_.pyc in not generated in the report folder, can't be the sources of error ?

there is the log again :

2014-11-07 11:06:17,591 4325 INFO myDB werkzeug: 192.168.34.2 - - [07/Nov/2014 11:06:17] "POST /web/action/load HTTP/1.1" 200 -
2014-11-07 11:06:18,301 4325 ERROR myDB openerp.service.web_services: Exception: u'report.account_facture'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 711, in go
    obj = netsvc.LocalService('report.'+object)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 98, in LocalService
    return Service._services[name]
KeyError: u'report.account_facture'
2014-11-07 11:06:18,553 4325 ERROR myDB openerp.netsvc: report.account_facture
(<type 'exceptions.KeyError'>, KeyError(u'report.account_facture',), <traceback object at 0xb0fc194>)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 654, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 760, in exp_report_get
    return self._check_report(report_id)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 738, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 71, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'report.account_facture', (<type 'exceptions.KeyError'>, KeyError(u'report.account_facture',), <traceback object at 0xb0fc194>))
2014-11-07 11:06:18,559 4325 INFO myDB werkzeug: 192.168.34.2 - - [07/Nov/2014 11:06:18] "POST /web/report HTTP/1.1" 500 -
2014-11-07 11:06:18,615 4325 DEBUG ? openerp.service.cron: cron0 polling for jobs
2014-11-07 11:06:26,768 4325 DEBUG ? openerp.service.cron: cron1 polling for jobs

 

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)

Stats

Asked: 11/5/14, 5:57 PM
Seen: 998 times
Last updated: 3/16/15, 8:10 AM