跳至内容
菜单
此问题已终结

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

形象
丢弃
相关帖文 回复 查看 活动
2
3月 15
6797
1
3月 15
5902
0
3月 15
3506
3
7月 24
8290
3
6月 17
7970