From 7d2eb331e01a3cc5e320814675dad6761acd9c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Jul 2013 14:51:43 +0200 Subject: [PATCH] Order lines for reconciliation By ordering lines on credit for receivable and debit for payable, we show the lines to proceed first. review952002 --- move.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index 357e543f1b..cd3537d463 100644 --- a/move.py +++ b/move.py @@ -1600,10 +1600,18 @@ class OpenReconcileLines(Wizard): open_ = StateAction('account.act_move_line_form') def do_open_(self, action): - action['pyson_domain'] = PYSONEncoder().encode([ + encoder = PYSONEncoder() + action['pyson_domain'] = encoder.encode([ ('account', '=', self.start.account.id), ('reconciliation', '=', None), ]) + if self.start.account.kind == 'receivable': + order = [('credit', 'DESC'), ('id', 'DESC')] + elif self.start.account.kind == 'payable': + order = [('debit', 'DESC'), ('id', 'DESC')] + else: + order = None + action['pyson_order'] = encoder.encode(order) return action, {}