Odoo Help

0

How to send filters to the pentaho report from OpenERP

By
Anuradha
on 8/19/13, 4:05 AM 3,675 views

I created a petaho report and uploaded it to open erp. now i want to print it by clicking print button. I have filters (date start , date end , caller) in form.How to send filters to the report from OpenERP ?

1
kh@lidoss
On 8/19/13, 7:47 AM

After you created the modele in pentaho with the parametrs(Filtrers) : date start, date end, caller. You should juste create a new penatho report in the menu : setup -->Technical --> Actions --> Pentaho report with your informations: Name, Name of service, Model, the file and you have to linked to menu After that you find the menu of this report after the linked menu, and if you open this menu, a new wizard open with the parametrs to enter. That's All

@kh@lidoss i have done all this then it shows error on clicking print "Pentaho returned no data for the report 'Calldetails'. Check report definition and parameters". Report details are Name:Calldetails,Model:smdrcalldata,Service Name:Calldetails,Output format:PDF,File :Download smdrcalldata_report.prpt . Ple3ase help me to find issue

Anuradha
on 10/28/13, 5:51 AM
0
Anuradha
On 8/19/13, 8:35 AM
I had done all this. I have a table calldata1 and i want to show its contents in report print. i created pentaho report by adding  calldata1 as datasource and uplodaded this report to open erp. Then i created a wizard table  calldata_print_report_wiz . i created a pop up window which displays datestart, date end ,caller from this table as filters. (similar to Reporting/Point of sale/Sale details).
How can i print data by passing filters to report code is
calldetails/calldata.py

from osv import osv,fields
class calldata1(osv.osv):
  _name = 'calldata1'
  _columns = {
              'Call_start': fields.datetime('Call start'),
              'Call_duration':fields.datetime('Call duration'),
               'Caller':fields.char('Caller'),
          }
calldata1()
calldetails/wizard/call_print.py

import logging
from openerp.osv import fields, osv
import time

class calldata_print_report_wiz(osv.osv_memory):
    _name = "calldata.print.report.wiz"
    def _sel_func(self, cr, uid,context=None):
       obj = self.pool.get('calldata1')
       ids = obj.search(cr, uid, [])
       res = obj.read(cr, uid, ids, ['id','Caller'], context)
       res =[(r['id'],r['Caller']) for r in res]
      return res

    _columns = {
        'date_start': fields.date('Date Start', required=True),
        'date_end': fields.date('Date End', required=True),
        'caller_id':fields.many2one(
        'calldata1',
        'caller_id',
        selection=_sel_func
        )
     }
    _defaults = {
        'date_start': lambda *a: time.strftime('%Y-%m-%d'),
        'date_end': lambda *a: time.strftime('%Y-%m-%d'),
     }

 def print_report(self, cr, uid, ids, context=None):
      if context is None:
            context = {}
      datas = {'ids': context.get('active_ids', [])}
      res = self.read(cr, uid, ids, ['date_start', 'date_end', 'caller_id'], context=context)
      res = res and res[0] or {}
      datas['form'] = res
      return {
            'type': 'ir.actions.report.xml',
            'report_name':'call1',
           }
calldata_print_report_wiz()

Any one please help?

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 8/19/13, 4:05 AM
Seen: 3675 times
Last updated: 3/16/15, 8:10 AM