changeset e097fb6bf10d in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=e097fb6bf10d
description:
        Try to reconcile all the lines

        issue11158
        review384131002
diffstat:

 move.py |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r e5e847225401 -r e097fb6bf10d move.py
--- a/move.py   Wed Jan 26 00:32:20 2022 +0100
+++ b/move.py   Sun Jan 30 13:05:00 2022 +0100
@@ -1835,11 +1835,17 @@
             requested = None
 
         currency = self.show.account.company.currency
+
+        all_lines = self._all_lines()
+        amount = sum((l.debit - l.credit) for l in all_lines)
+        if currency.is_zero(amount):
+            return [l.id for l in all_lines]
+
         chunk = config.getint('account', 'reconciliation_chunk', default=10)
         # Combination is exponential so it must be limited to small number
         default = []
         for lines in grouped_slice(
-                sorted(self._all_lines(), key=self._line_sort_key), chunk):
+                sorted(all_lines, key=self._line_sort_key), chunk):
             lines = list(lines)
             best = None
             for n in range(len(lines), 1, -1):

Reply via email to