[IMP] add an index on account_move_line(date, id)

fixes https://launchpad.net/bugs/1311004
This commit is contained in:
Alexandre Fayolle 2014-06-06 14:47:33 +02:00
parent 548c8e6675
commit 0ceee2a120
1 changed files with 3 additions and 0 deletions

View File

@ -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\'')
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('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
def _check_no_view(self, cr, uid, ids, context=None):