base: add index on ir_values
bzr revid: ced-f0bf4c561ffbc28384077e6340c6c15a2b815faa
This commit is contained in:
parent
35e3e9d684
commit
793f579077
|
@ -48,6 +48,14 @@ class ir_values(osv.osv):
|
|||
'key2': lambda *a: 'tree_but_open',
|
||||
'company_id': lambda *a: False
|
||||
}
|
||||
|
||||
def _auto_init(self, cr):
|
||||
super(ir_values, self)._auto_init(cr)
|
||||
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'ir_values_key_model_key2_index\'')
|
||||
if not cr.fetchone():
|
||||
cr.execute('CREATE INDEX ir_values_key_model_key2_index ON ir_values (key, model, key2)')
|
||||
cr.commit()
|
||||
|
||||
def set(self, cr, uid, key, key2, name, models, value, replace=True, isobject=False, meta=False, preserve_user=False, company=False):
|
||||
if type(value)==type(u''):
|
||||
value = value.encode('utf8')
|
||||
|
|
Loading…
Reference in New Issue