我添加了一个关于模块的新报告stock
(到 OpenERP v7 中),但是 rml 文件的路径对我来说似乎是正确的,当单击“打印”按钮时它说:
RML is not available at specified location or not enough data to print!
(None, None, None)
应该是我在 .py 文件上指定的路径中的错误,但我检查并重新检查,似乎是正确的。
这是我的代码:
import time
from openerp.report import report_sxw
class reporte_locacion(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(reporte_locacion, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'qty_total':self._qty_total
})
def _qty_total(self, objects):
total = 0.0
uom = objects[0].product_uom.name
for obj in objects:
total += obj.product_qty
return {'quantity':total,'uom':uom}
report_sxw.report_sxw(
'report.reporte.locacion',
'product.product',
'addons/stock/report/reporte_locacion.rml',
parser=reporte_locacion,
header='internal'
)
我已经在那个位置有它,它可以是stock_report.xml
文件吗?
以下是我声明报告的方式:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="reporte_locacion" model="product.product" name="reporte.locacion" string="Productos en almacen"/>
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Stock Level Forecast"/>
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking Slip" rml="stock/report/picking.rml"/>
<report id="report_picking_list_in" model="stock.picking.in" name="stock.picking.list.in" string="Receipt Slip" rml="stock/report/picking.rml"/>
<report id="report_picking_list_out" model="stock.picking.out" name="stock.picking.list.out" string="Delivery Slip" rml="stock/report/picking.rml"/>
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Inventory Overview" rml="stock/report/lot_overview.rml"/>
<report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content" rml="stock/report/lot_overview_all.rml"/>
<report id="report_stock_inventory_move" model="stock.inventory" name="stock.inventory.move" string="Stock Inventory" rml="stock/report/stock_inventory_move.rml"/>
</data>
</openerp>
关于它的第一个报告是有错误的,我错过了什么吗?
应该没问题,因为它的声明类型与其他报告几乎相同,但它们都可以正常工作。
有任何想法吗?
提前致谢!