i am use odoo version 8
i want to create custom report in account module.
in "account_report.xml"
<report
id="custom_report_all_invoice"
model="account.invoice"
string="Sekoo Report all invoice"
report_type="qweb-pdf"
name="account.partnerledger_sekoo_all"
attachment_use="False"
file="account.partnerledger_sekoo_all"
/>
in my "partnerledger_sekoo_all.py"
import time
import datetime
from dateutil.relativedelta import relativedelta
from openerp.osv import osv
from openerp.report import report_sxw
class partnerledger_sekoo_all_report_parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(partnerledger_sekoo_all_report_parser, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'lines': self.lines,
'get_partners':self._get_partners,
'hello_world': self._hello_world,
'invoices': self.invoices,
})
def invoices(self):
self.cr.execute(
"SELECT * FROM account_move_line l ")
res = self.cr.dictfetchall()
sum = 0.0
if self.initial_balance:
sum = self.init_bal_sum
for r in res:
sum += r['debit'] - r['credit']
r['progress'] = sum
full_account.append(r)
return full_account
def _hello_world(self):
return "Hello World!"
class partnerledger_sekoo_all(osv.AbstractModel):
_name = 'report.partnerledger_sekoo_all'
_inherit = 'report.abstract_report'
_template = 'partnerledger_sekoo_all'
_wrapped_report_class = partnerledger_sekoo_all_report_parser
in "partnerledger_sekoo_all.xml"
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="partnerledger_sekoo_all">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<div class="page">
<h2>Sekoo Partner Ledger all</h2>
<span t-esc="hello_world()"/>
</t>
</t>
</template>
</data>
</openerp>
i also make entry in __openerp.py__ of xml file
and in __init.py__ import partnerledger_sekoo_all_report_parser
but in template that not show anything,
it return error like
"'NoneType' object is not callable" while evaluating
'hello_world()'
how can i solve that please help
Do you have 'report' in depends, in __openerp__py?
@Zbik i make entry of report.xml file in __openerp__.py it render template and not show any error but parser method hello_world() not accessible in .xml file please specify if anything else is required for parser in report also any detail doc for that