Merge lp:~camptocamp/ocb-addons/6.1-fix_1311004_account_move_line_index-afe into lp:ocb-addons/6.1

Proposed by Alexandre Fayolle - camptocamp
Status: Merged
Approved by: Holger Brunn (Therp)
Approved revision: no longer in the source branch.
Merged at revision: 6842
Proposed branch: lp:~camptocamp/ocb-addons/6.1-fix_1311004_account_move_line_index-afe
Merge into: lp:ocb-addons/6.1
Diff against target: 13 lines (+3/-0)
1 file modified
account/account_move_line.py (+3/-0)
To merge this branch: bzr merge lp:~camptocamp/ocb-addons/6.1-fix_1311004_account_move_line_index-afe
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Yannick Vaucher @ Camptocamp code review, no test Approve
Pedro Manuel Baeza code review Approve
Guewen Baconnier @ Camptocamp code review Pending
OpenERP Core Team Pending
Review via email: mp+216820@code.launchpad.net

This proposal supersedes a proposal from 2014-04-22.

Description of the change

improve reading account_move_lines by using an index on date, id matching _order

port of https://code.launchpad.net/~camptocamp/openobject-addons/6.1-fix_1311004_account_move_line_index-afe/+merge/216687 to OCB (6.1)

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Posted in a previous version of this proposal

LGTM

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : Posted in a previous version of this proposal

It seems other revisions were dragged in.

Is it wanted ?

review: Needs Resubmitting
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Actually I had completely goofed the branches (uploaded my ocb branch to openobject-addons and proposed to merge there, hence the changes related to ocb present in the old MP).

Should be fixed now. Thanks for the heads up, Yannick.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks Alexandre, looks good now.

review: Approve (code review, no test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2012-09-06 14:35:17 +0000
3+++ account/account_move_line.py 2014-04-23 06:23:18 +0000
4@@ -567,6 +567,9 @@
5 cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
6 if not cr.fetchone():
7 cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
8+ cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',))
9+ if not cr.fetchone():
10+ cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)')
11
12 def _check_no_view(self, cr, uid, ids, context=None):
13 lines = self.browse(cr, uid, ids, context=context)

Subscribers

People subscribed via source and target branches