I am running the following code segment to print a jasper report in OpenERP
prev_open_fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft'), ('date_start', '<', fiscal_date_start)]) # prev_open_fiscalyear_ids gets a list of numbers from this code
cr.execute("SELECT id \
FROM account_period \
WHERE fiscalyear_id IN %s" , (tuple(prev_open_fiscalyear_ids)))
prev_period_ids = filter(None, map(lambda x:x[0], cr.fetchall()))
where cr is the database cursor to PostgreSQL db and I am getting the following error:

and the server log is
[2014-08-06 10:27:47,625][ASCO_ERP] ERROR:web-services:[01]: Exception: not all arguments converted during string formatting
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[02]: Traceback (most recent call last):
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[03]: File "/home/zbeanz/workspace/KIAK/service/web_services.py", line 724, in go
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[04]: (result, format) = obj.create(cr, uid, ids, datas, context)
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[05]: File "/home/zbeanz/workspace/KIAK/addons/jasper_reports/jasper_report.py", line 287, in create
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[06]: data['records'] = d.get( 'records', [] )
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[07]: File "/home/zbeanz/workspace/KIAK/addons/kiak_tb_report/JasperDataParser.py", line 53, in get
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[08]: self.generate_records(self.cr, self.uid, self.ids, self.data, self.context) or default_value
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[09]: File "/home/zbeanz/workspace/KIAK/addons/kiak_tb_report/report/trial_balance_report.py", line 149, in generate_records
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[10]: WHERE fiscalyear_id IN %s" % (tuple(prev_open_fiscalyear_ids)))
[2014-08-06 10:27:47,626][ASCO_ERP] ERROR:web-services:[11]: TypeError: not all arguments converted during string formatting
What is the problem associated with the query
tuple(prev_open_fiscalyear_ids))is just an empty tuple?(tuple(prev_open_fiscalyear_ids),)(notice the comma), does that help?