From 1136d8925642d731dad43b7383997bc4b6349af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Mon, 5 Sep 2022 10:34:24 +0200 Subject: [PATCH] [FIX] account_financial_report: Sort journal ledger by move_id Without this sort, and using auto-sequence, the numbers of the journal entries may appear unsorted on the journal ledger. Forcing at least this minimum sorting, we assure the items are sorted. TT38775 --- account_financial_report/__manifest__.py | 2 +- account_financial_report/report/journal_ledger.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index 72794b98..e431c132 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -6,7 +6,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Account Financial Reports", - "version": "15.0.1.2.0", + "version": "15.0.1.2.1", "category": "Reporting", "summary": "OCA Financial Reports", "author": "Camptocamp SA," diff --git a/account_financial_report/report/journal_ledger.py b/account_financial_report/report/journal_ledger.py index a1533768..ef566de4 100644 --- a/account_financial_report/report/journal_ledger.py +++ b/account_financial_report/report/journal_ledger.py @@ -84,7 +84,10 @@ class JournalLedgerReport(models.AbstractModel): return [("display_type", "=", False), ("move_id", "in", move_ids)] def _get_move_lines_order(self, move_ids, wizard, journal_ids): - return "" + """Add `move_id` to make sure the order of the records is correct + (especially if we use auto-sequence). + """ + return "move_id" def _get_move_lines_data(self, ml, wizard, ml_taxes, auto_sequence, exigible): base_debit = (