Odoo Help


how to customize a report in openerp8

feriel bendimerad
on 5/8/14, 7:12 AM 2,403 views

hello , i'm working on Openerp8 , i have used inheritance to customize the report account invoice like i'v used in openerp7. here is my code:

# -*- coding: utf-8 -*-
#!/usr/bin/env pythons
from openerp.addons.account.report import account_print_invoice
from integerToWords_fr import final_result
import locale 
from openerp.report import report_sxw
import logging
from logging import Logger
logger = logging.getLogger('trainings module')
# create a custom parser inherited from sale order parser:
class new_account_invoice(account_print_invoice.account_invoice):
    '''Custom parser with an additional method
    def __init__(self, cr, uid, name, context):
        super(new_account_invoice, self).__init__(cr, uid, name, context)


    def droit_timbre(self,s):
            if s<=20: return 0
            elif s>20  and s<=500 : return 5 
            elif s>500 and s<250000: return round((s/100)+0.49)
            elif s>=250000: return 2500

# remove previous account.report service :
from netsvc import Service
del Service._services['report.account.invoice']

# register the new report service :

i've got error this error: File "/usr/lib/pymodules/python2.7/openerp/addons/l10n_dz/report/account_print_invoice_dz.py", line 52, in <module> from netsvc import Service ImportError: No module named netsvc


Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 5/8/14, 12:03 PM

Hi, Try this

from openerp import netsvc
del netsvc.Service._services['report.account.invoice']

Instead of this

from netsvc import Service
del Service._services['report.account.invoice']
Sylvain Van Hoof
On 10/8/14, 8:39 AM


With the lastest version of Odoo, the class Service doesn't yet existing.

"ParseError: "'module' object has no attribute 'Service'" while parsin"

What is the best solution to fix it ?

Thanks you ! 

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/8/14, 7:12 AM
Seen: 2403 times
Last updated: 3/16/15, 8:10 AM