← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 746429] Re: [6.1 trunk] [hr_timesheet] : Print report error

 

On 01. 04. 11 07:41, Azazahmed Saiyed (OpenERP) wrote:
> Hello Bogdan,
>
> Check with the latest trunk and no traceback appears at my end. I have
> also tested it with the both clients but there seems to be no traceback.
>
> >From the traceback it appears that this can be possible when will you
> again refer the data['employee_id'][0] after assignment it to
> data['employee_id'].
>
> I am able to get the traceback by doing explicitly above changes.
>
> Thanks.
>
> ** Changed in: openobject-addons
>        Status: New => Incomplete
>
as I said, i have the latest trunk (today 4617).

i am trying to follow you, but nothing is that explicit in your message.
sorry.

here the code:

defprint_report(self, cr, uid, ids, context=None):

data =self.read(cr, uid, ids, context=context)[0]

data['employee_id'] =data['employee_id'][0]

datas ={

'ids': [],

'model': 'hr.employee',

'form': data

}

return{

'type': 'ir.actions.report.xml',

'report_name': 'hr.analytical.timesheet',

'datas': datas,

}


it is as it comes... so?
btw, datas is a "plural" of a plural. doesn't really matter for the
functionality, but it is not "nice". datum - data.

thank you!
b

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/746429

Title:
  [6.1 trunk] [hr_timesheet] : Print report error

Status in OpenERP Modules (addons):
  Incomplete

Bug description:
  latest rev
  when trying to print from
  HR>Reporting>Timesheet>Employee timesheet
  i get the following error:

  Environment Information : 
  System : Linux-2.6.35-28-generic-i686-with-Ubuntu-10.10-maverick
  OS Name : posix
  Distributor ID:	Ubuntu
  Description:	Ubuntu 10.10
  Release:	10.10
  Codename:	maverick
  Operating System Release : 2.6.35-28-generic
  Operating System Version : #49-Ubuntu SMP Tue Mar 1 14:40:58 UTC 2011
  Operating System Architecture : 32bit
  Operating System Locale : fr_CH.UTF8
  Python Version : 2.6.6
  OpenERP-Client Version : 6.1-dev
  Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 410, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 598, in dispatch
      res = fn(db, uid, *params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/openerp/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py", line 53, in print_report
      data['employee_id'] = data['employee_id'][0]
  TypeError: 'int' object is unsubscriptable

  thank you!



References