Report 开发求助!
-
大家好,我设计了两个报表,公用同一个rml文件!
一个指向 stock_tracking,一个指向stock_production_lot.
但是只有stocking_production_lot 的报告,能正确显示数据,
stock_tracking里显示的都是空白!
还请指教一下!
<report auto="False" id="report_roquette_coa_tracking" model="stock.tracking" name="roquette.coa" rml="roquette/report/coa.rml"
string="COAII"/>
<report auto="False" id="report_roquette_coa_prodlot" model="stock.production.lot" name="roquette.coa" rml="roquette/report/coa.rml" string="COAI"/>
这个是view 里的。
class roquette_coa_tracking(report_sxw.rml_parse):
def init(self, cr, uid, name, context):
super(roquette_coa_tracking, self).init(cr, uid, name, context)
self.localcontext.update({
'time': time,
'user': self.pool.get('res.users').browse(cr, uid, uid, context)
})
report_sxw.report_sxw('report.roquette.coa','stock.tracking','addons/roquette/report/coa.rml',parser=roquette_coa_tracking)
class roquette_coa_prodlot(report_sxw.rml_parse):
def init(self, cr, uid, name, context):
super(roquette_coa_prodlot, self).init(cr, uid, name, context)
self.localcontext.update({
'time': time,
'user': self.pool.get('res.users').browse(cr, uid, uid, context)
})
report_sxw.report_sxw('report.roquette.coa','stock.production.lot','addons/roquette/report/coa.rml',parser=roquette_coa_prodlot)
report。py 文件。