レポートを印刷したい。パートナーシップという名前のモジュールが addons フォルダーの下にあります。パートナーシップ フォルダーの下には、次のコードを含む new_report.rml new_report.sxw と new_report.py クラスを含むフォルダーがあります。
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/partnership/report/new_report.rml',
parser=new_report)
アドオン/パートナーシップパートナーシップの下で、次のコードを含むreport.xmlを報告します。
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<report
auto="False"
id="new_report_id"
model="contratcommercial"
name="commercial_report"
rml="partnership/report/new_report.rml"
string="imprimer contrat "/>
</data>
</openerp>
しかし、私はまだこのエラーがあります
report.commercial_report (<type 'exceptions.KeyError'>, KeyError(u'report.commercial_report',), <traceback objectat 0x06F19DC8>)