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 printing report openerp ???

By
kais dkhili
on 5/11/14, 4:11 PM 863 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'),

}
contrat()
class contratcommercial(osv.osv):
_name='contratcommercial'
_inherit='contrat'
_rec_name = 'titreContrat'
_columns = {
    'id_partenaire_commercial':fields.many2one('commercial','Commercial'),
}
contratcommercial()

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)
    self.localcontext.update({
        '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"?>
 <openerp>
    <data>
            <report
                    id="id_commercialcontrat"
                    string="print contrat "
                    model="contratcommercial"
                    name="new_report"
                    rml="partnership/report/commercialcontrat.rml"
                    auto="False"
                    header="False"/>
    </data>

</openerp>

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)

Stats

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