Odoo Help


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.


error printing report openerp ???

kais dkhili
on 5/11/14, 4:11 PM 839 views

i want to print a report for may class contrat commmercial, and this is her code in the fil partnership.py

class contrat(osv.osv):
_name = 'contrat'
_rec_name = 'titreContrat'
_columns = {
    'id_contrat':fields.integer('Numero Contrat'),
    'date_contrat':fields.date('Date Contrat'),
    'titreContrat': fields.char('Titre contrat',size=64),
    'descriptionContrat':fields.text('Description contrat'),
    'lst_termes':fields.one2many('terme','id_terme','Liste des termes'),

class contratcommercial(osv.osv):
_rec_name = 'titreContrat'
_columns = {

i have created the report with openoffice and save it into a file commercialcontrat.sxw and convert it to commercialcontrat.rml and i defined a commercialcontrat.py with thw following code

import time
from openerp.report import report_sxw
class new_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
    super(new_report, self).__init__(cr, uid, name, context)
        'time': time,

  report_sxw.report_sxw('report.new_report', 'contratcommercial',
  'addons/partnership/report/commercialcontrat.rml', parser=new_report, header="external")

i have defined import commercialcontrat in the __init__.py and in the file partnership_report.xml i have writed the following codes:

<?xml version="1.0"?>
                    string="print contrat "


i have always the following error : except_osv: (u'report.new_report', (<type 'exceptions.keyerror'="">, KeyError(u'report.new_report',), <traceback object="" at="" 0x04e64918="">) really i dont know what is the problem please someone help me

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)


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