diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 7ccd07351f0..1ff7777cf36 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -978,7 +978,7 @@ class calendar_event(osv.osv): if not context: context = {} for event_id in ids: - cr.execute('select id from %s where recurrent_uid=%s' % (self._table, event_id)) + cr.execute("select id from %s where recurrent_uid=%%s" % (self._table), (event_id,)) r_ids = map(lambda x: x[0], cr.fetchall()) self.unlink(cr, uid, r_ids, context=context) return True @@ -1065,7 +1065,7 @@ class calendar_event(osv.osv): 'rule_type': rrule_type, 'id': id, }) - cr.execute(qry, val) # Hopefully psycopg2 works with dicts. But, FIXME + cr.execute(qry % val) return True def _get_rulestring(self, cr, uid, ids, name, arg, context=None): @@ -1438,7 +1438,8 @@ true, it will allow you to hide the event alarm information without removing it. res = super(calendar_event, self).search(cr, uid, args_without_date, \ offset, limit, order, context, count) - return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit) + res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit) + return res def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ @@ -1533,11 +1534,9 @@ true, it will allow you to hide the event alarm information without removing it. if fields and 'date' not in fields: fields.append('date') - real_ids = [item2 for item1, item2 in select] - event_values = dict([(res['id'], res) for res in super(calendar_event, self).read(cr, uid, real_ids, fields=fields, context=context, load=load)]) - for base_calendar_id, real_id in select: - res = event_values[real_id] + #REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn + res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load) ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: res['date'] = ls[1] diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index d22fa98f6e4..068af56459f 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -63,11 +63,12 @@ def uid2openobjectid(cr, uidval, oomodel, rdate): return (False, None) qry = 'SELECT DISTINCT(id) FROM %s' % model_obj._table if rdate: - qry += " WHERE recurrent_id=%s" - cr.execute(qry, (rdate,)) + qry += " where recurrent_id='%s'" % (rdate) #TOFIX: sql injection + cr.execute(qry) r_id = cr.fetchone() if r_id: return (id, r_id[0]) + cr.execute(qry) ids = map(lambda x: str(x[0]), cr.fetchall()) if id in ids: diff --git a/addons/hr_timesheet_invoice/report/cost_ledger.py b/addons/hr_timesheet_invoice/report/cost_ledger.py index 8daf40fded6..18de548ad1c 100644 --- a/addons/hr_timesheet_invoice/report/cost_ledger.py +++ b/addons/hr_timesheet_invoice/report/cost_ledger.py @@ -167,7 +167,7 @@ report_sxw.report_sxw( 'report.hr.timesheet.invoice.account.analytic.account.cost_ledger', 'account.analytic.account', 'addons/hr_timesheet_invoice/report/cost_ledger.rml', - parser=account_analytic_cost_ledger, header=False) + parser=account_analytic_cost_ledger, header='internal') # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py index c95bd33ac32..4aa4b099c57 100644 --- a/addons/survey/report/survey_analysis_report.py +++ b/addons/survey/report/survey_analysis_report.py @@ -46,9 +46,6 @@ class survey_analysis(report_rml): """+to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True))+""" """+ to_xml(company.name) +""" - - / - 1.3cm 28.1cm 20cm 28.1cm @@ -426,6 +423,7 @@ class survey_analysis(report_rml): rml += """""" report_type = datas.get('report_type', 'pdf') create_doc = self.generators[report_type] + self.pageCount=True pdf = create_doc(rml, title=self.title) return (pdf, report_type) diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index a8bfa906c90..d024e410d0e 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -273,7 +273,7 @@ class survey_browse_response(report_rml): style = 'tbl_white' else: style = 'tbl_gainsboro' - i +=1 + i +=1 rml += """""" table_data = col_heading.browse(cr, uid, col_heading.search(cr, uid, [('response_table_id', '=', answer[0].id), ('name', '=', row)])) for column in matrix_ans: @@ -520,6 +520,7 @@ class survey_browse_response(report_rml): rml += """""" report_type = datas.get('report_type', 'pdf') create_doc = self.generators[report_type] + self.pageCount=False pdf = create_doc(rml, title=self.title) return (pdf, report_type) diff --git a/addons/survey/report/survey_form.py b/addons/survey/report/survey_form.py index 5a7d5e283e3..5836be2d399 100644 --- a/addons/survey/report/survey_form.py +++ b/addons/survey/report/survey_form.py @@ -389,8 +389,8 @@ class survey_form(report_rml): rml += """""" report_type = datas.get('report_type', 'pdf') create_doc = self.generators[report_type] + self.pageCount=False pdf = create_doc(rml, title=self.title) - return (pdf, report_type) survey_form('report.survey.form', 'survey','','')