improvement

bzr revid: fp@tinyerp.com-20081025085356-9ezz9r2qj6q52a3r
This commit is contained in:
Fabien Pinckaers 2008-10-25 10:53:56 +02:00
parent 9f02474155
commit d5e50a5159
3 changed files with 9 additions and 2 deletions

View File

@ -373,7 +373,7 @@ class module(osv.osv):
m.state not in ('uninstalled','uninstallable','to remove')''', (module.name,))
res = cr.fetchall()
if res:
raise orm.except_orm(_('Error'), _('The module you are trying to remove depends on installed modules :\n %s') % '\n'.join(map(lambda x: '\t%s: %s' % (x[0], x[1]), res)))
raise orm.except_orm(_('Error'), _('Some installed modules depends on the module you plan to desinstall :\n %s') % '\n'.join(map(lambda x: '\t%s: %s' % (x[0], x[1]), res)))
self.write(cr, uid, ids, {'state': 'to remove'})
return True

View File

@ -124,6 +124,12 @@ class boolean(_column):
_symbol_set = (_symbol_c, _symbol_f)
class integer_big(_column):
_type = 'integer_big'
_symbol_c = '%d'
_symbol_f = lambda x: int(x or 0)
_symbol_set = (_symbol_c, _symbol_f)
class integer(_column):
_type = 'integer'
_symbol_c = '%d'
@ -675,7 +681,7 @@ class related(function):
where += " %s.%s %s '%%%s%%' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2])
if field_detail[1] in ('date'):
where += " %s.%s %s '%s' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2])
if field_detail[1] in ['integer', 'long', 'float']:
if field_detail[1] in ['integer', 'long', 'float','integer_big']:
where += " %s.%s %s '%d' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2])
query += where.rstrip('and')
cr.execute(query)

View File

@ -244,6 +244,7 @@ def get_pg_type(f):
type_dict = {
fields.boolean: 'bool',
fields.integer: 'int4',
fields.integer_big: 'int8',
fields.text: 'text',
fields.date: 'date',
fields.time: 'time',