Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


OpenERP 7 Reports Error

on 5/8/13, 5:27 AM 1,876 views

(<type 'exceptions.KeyError'>, KeyError(u'report.bpl.daily.transaction',), <traceback object at 0xb1911f04>)

now I'm going to report generating part.i refer more modules in openerp & created my own code.but above error comes when i clicked print button. my requirement is get all data in bpl.daily.transaction.master table & view them.

please advice me to implement this

here is my bpl_report.py class

class bpl_daily_transaction_report(osv.osv_memory):
    _name = 'bpl.daily.transaction.report'
    _description = 'bpl daily transaction report'
    _columns = {
        'bpl_company_id':fields.many2one('res.company', 'Company', help='Company'),
        'bpl_estate_id':fields.many2one('bpl.estate.n.registration', 'Estate', help='Estate'),
        'bpl_division_id':fields.many2one('bpl.division.n.registration', 'Division', help='Division', domain="[('estate_id','=',bpl_estate_id)]"),
        'date': fields.date('Date', required=True),
    _defaults = {'date': lambda *a: time.strftime('%Y-%m-01'),}

    def print_report(self, cr, uid, ids, context=None):
        datas = {
             'ids': [],
             'model': 'bpl.daily.transaction.master',
             'form': self.read(cr, uid, ids)[0]
        return {
            'type': 'ir.actions.report.xml',
            'report_name': 'bpl.daily.transaction',
            'datas': datas,

and here shows my bpl_report.xml file.seems issue in here.i'm still at beginner level in openerp reporting.

<?xml version="1.0" encoding="utf-8"?>
<record id="daily_transaction_report_action" model="ir.actions.act_window">
    <field name="name">Daily Transaction Report</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">bpl.daily.transaction.report</field>
    <field name="view_type">form</field>
    <field name="view_mode">form,tree</field>
    <field name="target">new</field>
<record id="daily_transaction_report_view" model="ir.ui.view">
    <field name="name">bpl.daily.transaction.report.form</field>
    <field name="model">bpl.daily.transaction.report</field>
    <field name="arch" type="xml">
    <form string="Daily Transaction Report" version="7.0">
        <field name="bpl_company_id" />
        <field name="bpl_estate_id" />
        <field name="bpl_division_id" />
        <field name="date" />
        <button name="print_report" string="Print" type="object" 
            class="oe_highlight" />
        <button string="Cancel" special="cancel" class="oe_link" />

<report id="report_bpl_daily_transaction" string="Daily Transaction"
    model="bpl.daily.transaction.report" name="bpl.daily.transaction"
    auto="False" menu="False" />
<menuitem id="menu_checkroll_reporting" parent="base.menu_reporting"
    name="Checkroll" />
<menuitem id="menu_checkroll_reports" name="Reports"
    parent="menu_checkroll_reporting" />
<menuitem name="Daily Transaction Report" parent="menu_checkroll_reports"
    action="daily_transaction_report_action" id="menu_daily_transaction_report" />

please help me to sort out this issue.


Ghanshyam Prajapati

--Ghanshyam Prajapati--
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 5/8/13, 7:23 AM

Please see following link

  • http://forum.openerp.com/forum/topic26308.html (KeyError)

Hope it will work.

thanks Ghanshyam :-) will check & try to solve it

on 5/8/13, 8:35 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 5/8/13, 5:27 AM
Seen: 1876 times
Last updated: 3/16/15, 8:10 AM