[FIX] missing comma in sql query 'execute' call ("select count...")

[FIX] removed deprecated module 'string'
[FIX] indentation errors

bzr revid: olt@tinyerp.com-20100903070330-v5gy27t7jx093tvp
This commit is contained in:
olt@tinyerp.com 2010-09-03 09:03:30 +02:00
parent bce9084499
commit 827ce83b57
1 changed files with 42 additions and 43 deletions

View File

@ -44,7 +44,6 @@ import logging
import operator
import pickle
import re
import string
import time
import traceback
import types
@ -2223,7 +2222,7 @@ class orm(orm_template):
tables, where_clause, qfield = self._inherits_join_calc(groupby,tables,where_clause)
if len(where_clause):
where_clause = ' where '+string.join(where_clause, ' and ')
where_clause = ' where ' + ' and '.join(where_clause)
else:
where_clause = ''
limit_str = limit and ' limit %d' % limit or ''
@ -2272,7 +2271,7 @@ class orm(orm_template):
if not isinstance(groupby_list,(str, unicode)):
if groupby or not context.get('group_by_no_leaf', False):
d['__context'] = {'group_by':groupby_list[1:]}
if groupby and fget.has_key(groupby):
if groupby and groupby in fget:
if d[groupby] and fget[groupby]['type'] in ('date','datetime'):
dt = datetime.datetime.strptime(alldata[d['id']][groupby][:7],'%Y-%m')
days = calendar.monthrange(dt.year, dt.month)[1]
@ -3272,7 +3271,7 @@ class orm(orm_template):
for group in groups:
module = group.split(".")[0]
grp = group.split(".")[1]
cr.execute("select count(*) from res_groups_users_rel where gid IN (select res_id from ir_model_data where name=%s and module=%s and model=%s) and uid=%s" \
cr.execute("select count(*) from res_groups_users_rel where gid IN (select res_id from ir_model_data where name=%s and module=%s and model=%s) and uid=%s", \
(grp, module, 'res.groups', user))
readonly = cr.fetchall()
if readonly[0][0] >= 1:
@ -3760,7 +3759,7 @@ class orm(orm_template):
upd1.append(id)
if upd0 and upd1:
cr.execute('update "' + self._table + '" set ' + \
string.join(upd0, ',') + ' where id = %s', upd1)
','.join(upd0) + ' where id = %s', upd1)
else:
for f in val: