Odoo Help

Welcome!

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.

0

Open erp pentaho report printing not works

By
Anuradha
on 10/29/13, 8:44 AM 667 views

I am working printing pentaho report in openerp. It was working fine but after i did some code modification (changing variable name) its not working. i spend long time for finding issue but failed . Any one please help my code is

def print_report(self, cr, uid, ids, context=None):
 38         _logger = logging.getLogger(__name__)
 39         datas = {}
 40         if context is None:
 41             context = {}
 42         res = self.read(cr, uid, ids, ['date_start', 'date_end', 'caller_id','caller_entry'], context=context)
 43         caller_id  = ''
 44         caller_entry = res[0]['caller_entry']
 45         date_start = res[0]['date_start'] + ' 00:00:00'
 46         date_end = res[0]['date_end'] +  ' 23:59:59'
 47         if res[0]['caller_id']:
 48             caller_id = res[0]['caller_id']
 49         calldata_obj = self.pool.get('smdrcalldata')
 50         if caller_entry:
 51             ids  = calldata_obj.search(cr, uid, [('call_start','>=',date_start),('call_start','<=',date_end),('caller','=',caller_entry)])
 52         elif caller_id:
 53             cr.execute("select caller from smdrcalldata where id=%s",(caller_id,))
 54             caller = cr.fetchone()
 55             ids  = calldata_obj.search(cr, uid, [('call_start','>=',date_start),('call_start','<=',date_end),('caller','=',caller[0])])
 56         else:
 57             ids  = calldata_obj.search(cr, uid, [('call_start','>=',date_start),('call_start','<=',date_end)])
 58         calldats = calldata_obj.read(cr, uid, ids, ['caller','call_start'], context)
 59         _logger.info('Create a with vals ..............................%s', calldats)
 60         _logger.info('Create a with idsss ..............................%s',ids )
 61         datas['ids'] = ids
 62         datas['form']= calldats
 63         datas['model']= 'smdrcalldata'
 64         if (ids == []):
 65             datas = {}
 66         return {
 67              'type': 'ir.actions.report.xml',
 68              'report_name':'smdrcalldata_report',
 69              'datas':datas,
 70         }

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)

Stats

Asked: 10/29/13, 8:44 AM
Seen: 667 times
Last updated: 3/16/15, 8:10 AM