Everythin工作正常但我点击打印按钮时无法获得报告
在反馈模块中,我有以下方式的文件,feedback_report.xml,hourly_feedback.py,hourly_feedback.xml,__ init__.py,__ openerp __。py.Have views文件夹,report_hourly.xml < / p>
feedback_report.xml包含以下代码。
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="action_hourly_feedback"
string="Hourly Report"
model="hourly.form"
report_type="qweb-pdf"
name="hourly.form.report_hourly"
file="hourly.form.report_hourly"
/>
</data>
</openerp>
hourly_feedback.py有以下代码
from openerp.osv import fields, osv
from openerp import api
import logging
class hourly_form(osv.Model):
_name = 'hourly.form'
_rec_name = 'assetmodelid_add'
_columns = {
'assetmodelid_add' : fields.many2one('agile.portfolio1','Asset Model Code',),
'folio_num1' : fields.many2one('asset.asset','Folio Num',),
'inspection_name' : fields.many2one('asset1.inspection','Inspection Type'),
}
hourly_form()
hourly_feedback.xml包含以下代码,
<record model='ir.ui.view' id="hour_event">
<field name="names">hourly.form.form</field>
<field name="model">hourly.form</field>
<field name="arch" type="xml">
<form string="Hours">
<group>
<field name="assetmodelid_add" />
<field name="folio_num1" domain="[('assetmodelid_add', '=', assetmodelid_add)]"/>
<field name="inspection_name" domain="[('assetmodelid_add', '=', assetmodelid_add)]"/>
</group>
</form>
</field>
</record>
<record id="hourly_event_action" model="ir.actions.act_window">
<field name="name">Hourly Form</field>
<field name="res_model">hourly.form</field>
<field name="view_type">form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_creat"> Click here</p>
</field>
</record>
<menuitem id="hourlyfeed_form_creation" name="Hourly Maintainace Form" parent="base.menu_mro_root" />
<menuitem id="hfeed_form_creation" name="Hourly Maintainace Form" parent="hourlyfeed_form_creation" action="hourly_event_action"/>
</data>
</openerp>
openerp .py包含以下代码
{
'name':'Hourly Form',
'version':'1.0',
'description':"""
Feedback Form
""",
'author':'shrihar',
'depends':['base_setup','calendar','Configuration','asset','stock','asset_edit','calander_extended',],
'data':['hourly_feedback.xml','views/report_hourly.xml','feedback_report.xml',],
'demo':[],
'installable':True,
'auto_install':False,
}
在view / report_feedback.xml中有以下代码
<openerp>
<data>
<template id="report_hourly">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<h2>Hour Report</h2>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>
一切正常,但我无法获得报告其gettin json错误请求添加代码
答案 0 :(得分:3)
report_hourly
模板在views/report_feedback.xml
下定义,因此您需要将views/report_feedback.xml
添加到__openerp__.py
中的数据。