Skip to Content
Menu
This question has been flagged

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

Avatar
Discard
Related Posts Replies Views Activity
2
Mar 15
6790
1
Mar 15
5899
0
Mar 15
3502
3
Jul 24
8257
3
Jun 17
7965