Skip to content

Commit

Permalink
[IMP] account: sort lines in reconciliation widget as in list view
Browse files Browse the repository at this point in the history
  • Loading branch information
smetl committed Sep 18, 2018
1 parent 60e9aad commit 02ed7a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion addons/account/models/reconciliation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ def get_bank_statement_data(self, bank_statement_ids):
for line in results:
Bank_statement_line.browse(line.get('id')).write({'partner_id': line.get('partner_id')})

# Keep the same order as the table.
sorted_st_lines = sorted(st_lines_left, key=lambda line: (line.statement_id.id, line.date, -line.sequence, line.id), reverse=True)
sorted_st_lines_ids = [line.id for line in sorted_st_lines]

return {
'st_lines_ids': st_lines_left.ids,
'st_lines_ids': sorted_st_lines_ids,
'notifications': [],
'statement_name': len(bank_statements) == 1 and bank_statements[0].name or False,
'journal_id': bank_statements and bank_statements[0].journal_id.id or False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Tour.register('bank_statement_reconciliation', {

{
content: "reconcile the line",
trigger: '.o_reconciliation_line:last .o_reconcile:visible',
trigger: '.o_reconciliation_line:nth-child(1) .o_reconcile:visible',
},

// Reconciliation of 'First 2000 $ of INV/2018/0001'
Expand Down

0 comments on commit 02ed7a6

Please sign in to comment.