Printing Employee Timesheet report results in "list index out of range" error

Asked by Bill Ennals

Hi,

(I tried to ask this question in the general OpenERP section but somehow it wound up in the installer section and got no response, so I'll try again here)

I'm trying to print the report 'Employee Timesheet' in Human Resources from the Reporting menu in OpenERP v7 (nightly build from last week) on Ubuntu 12.04 on a virtual server (VirtualBox) from Firefox on a Mac client (10.6.8).

The following error results:

list index out of range

(<type 'exceptions.IndexError'>, IndexError('list index out of range',), <traceback object at 0xb1234dec>)

There are a number of timesheets in the database with varying states (draft, confirm and done). I have created another database with the demo data in it and I can print the reports fine there, so I'm guessing that it's a problem with the configuration of this specific database or the data that has been entered in one/some of the time sheets.

I have noticed that I can print the report successfully for the one employee that does not have a user attached to them. All other employees have users attached to them and the above error results when trying to print the report for them.

Can anyone suggest where I might start looking to narrow the problem down.

Thanks,

Bill.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Serpent Consulting Services
Solved:
Last query:
Last reply:
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#1

Bill,

Would you please paste the complete traceback of server when this error is thrown?

Thanks.

Revision history for this message
Bill Ennals (bennals) said :
#2

Hi,

Sorry for the long delay, but please find the complete traceback pasted in below. Hope you can point me in the right direction.

Thanks,

Bill.

2013-12-21 00:19:07,531 32100 ERROR rgerp openerp.service.web_services: Exception: list index out of range
Traceback (most recent call last):
  File "/opt/openerp70/server/openerp/service/web_services.py", line 712, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/opt/openerp70/server/openerp/report/interface.py", line 83, in create
    xml = self.create_xml(cr, uid, ids, datas, context)
  File "/opt/openerp70/server/openerp/addons/hr_timesheet/report/user_timesheet.py", line 98, in create_xml
    ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name))
  File "/opt/openerp70/server/openerp/report/report_sxw.py", line 289, in formatLang
    self._get_lang_dict()
  File "/opt/openerp70/server/openerp/report/report_sxw.py", line 242, in _get_lang_dict
    lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])[0]
IndexError: list index out of range
2013-12-21 00:19:07,607 32100 ERROR rgerp openerp.netsvc: list index out of range
(<type 'exceptions.IndexError'>, IndexError('list index out of range',), <traceback object at 0xb3780d24>)
Traceback (most recent call last):
  File "/opt/openerp70/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp70/server/openerp/service/web_services.py", line 654, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp70/server/openerp/service/web_services.py", line 760, in exp_report_get
    return self._check_report(report_id)
  File "/opt/openerp70/server/openerp/service/web_services.py", line 738, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/opt/openerp70/server/openerp/netsvc.py", line 71, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'list index out of range', (<type 'exceptions.IndexError'>, IndexError('list index out of range',), <traceback object at 0xb3780d24>))

Revision history for this message
Best Serpent Consulting Services (serpent-consulting-services) said :
#3

Bill,

Either you deactivated the language OR have used wrong code for your language.

Please check by admin login and under settings!

Thanks.

Revision history for this message
Bill Ennals (bennals) said :
#4

Wow, it was that simple. Thanks Serpent.

I had deactivated english_US as we use english_GB in Australia. Reactivating it fixed the problem immediately. It's a shame that OpenERP doesn't provide more useful error information but now I read the full traceback in the log I can see the last lines before the 'list index out of range' error are references to language related data.

Revision history for this message
Bill Ennals (bennals) said :
#5

Thanks Serpent Consulting Services, that solved my question.