Shridhar Ivani Shridhar Ivani - 1 month ago 11
Python Question

How to generate report in this module odoo i have done this much?

Everythin is working fine but i am not able to get report when i click on print button

In feedback module i have following way of files , feedback_report.xml,,hourly_feedback.xml, , views folder inside this ,report_hourly.xml

feedback_report.xml has following code .

<?xml version="1.0" encoding="utf-8"?>
string="Hourly Report"
</openerp> has following code

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_feedback.xml has following code ,

<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">

<field name="assetmodelid_add" />
<field name="folio_num1" domain="[('assetmodelid_add', '=', assetmodelid_add)]"/>
<field name="inspection_name" domain="[('assetmodelid_add', '=', assetmodelid_add)]"/>


<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>

<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"/>

</openerp> has following code

'name':'Hourly Form',
Feedback Form

In view/report_feedback.xml has following code

<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>


everything is working fine but i am not able to get report its gettin json error pleas add code


report_hourly template is defined under views/report_feedback.xml, so you need to add views/report_feedback.xml to data in