[IMP] add an index on account_move_line(date, id)
fixes https://launchpad.net/bugs/1311004
This commit is contained in:
parent
548c8e6675
commit
0ceee2a120
|
@ -566,6 +566,9 @@ class account_move_line(osv.osv):
|
||||||
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
|
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
|
||||||
if not cr.fetchone():
|
if not cr.fetchone():
|
||||||
cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
|
cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
|
||||||
|
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',))
|
||||||
|
if not cr.fetchone():
|
||||||
|
cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)')
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _check_no_view(self, cr, uid, ids, context=None):
|
def _check_no_view(self, cr, uid, ids, context=None):
|
||||||
|
|
Loading…
Reference in New Issue