1 python openoffice.org report openoffice-writer openerp
我正在尝试使用报告插件和openoffice创建一个新报告,但我不知道如何在OpenERP系统中分配它.
是否有人可以为我提供创建新报告和与openerp集成的确切步骤?
提前致谢!
以下是创建OpenERP RML报告的步骤.
打开open-office.org
将.sxw转换为.rml
$> cd to base-report-designer/openerp_sxw2rml $> python openerp_sxw2rml.py ../../exam/report/.sxw > ../../exam/report/.rml(在报告文件夹中)
exam.py(或从http://doc.openerp.com/v6.0/developer/3_11_reports/11_1_openoffice_report.html复制):
import time
from report import report_sxw
class exam(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(exam, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.exam.student', 'exam.student',
'addons/exam/report/exam.rml', parser=exam, header=True)
Run Code Online (Sandbox Code Playgroud)(exam.py,exam.rml,exam.sxw,__ init__.py)
__init__.py:
import exam
Run Code Online (Sandbox Code Playgroud)(主要考试文件夹)
exam_report.xml
<?xml version="1.0"?>
<openerp>
<data>
<report
id="exam_student"
string="Print Exam..."
model="exam.student"
name="exam.student"
rml="exam/report/exam.rml"
auto="False"
header="False"/>
</data>
</openerp>
Run Code Online (Sandbox Code Playgroud)__openerp__.py
在更新→ 'exam_report.xml'
__init__.py
import report
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
6074 次 |
| 最近记录: |