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

printing report but fields dont appeaar ????

By
kais dkhili
on 5/12/14, 7:21 PM 648 views

i have a class Terme that contains a foreign key to the class contrat, Terme and Contrat are defined by the following code:

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 terme(osv.osv):
_name = 'terme'
_rec_name = 'intituleterme'
_columns = {
    'id_terme':fields.integer('Numero Terme'),
     'intituleterme': fields.char('Intitule Terme',size=64),
     'descriptionterme':fields.text('Description du Terme'),
    'id_contrat':fields.many2one('contrat','contrat'),


}
terme()

i want to print a contrat that contains many termes, i use openoffice, but the probleme that the fields of termes dose not appear , please someone help me this is the code of the class new_report:`

 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=context)
    self.localcontext.update( {'time': time,
                                })

   report_sxw.report_sxw('report.new_report', 'contratcommercial',
                  'addons/report/new_report.rml',
                  parser=new_report)

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/12/14, 7:21 PM
Seen: 648 times
Last updated: 3/16/15, 8:10 AM