From 7d9d1cb006fe667df3dabea479bfc4c60cac5112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 27 Apr 2021 07:06:31 +0100 Subject: [PATCH 1/2] [FIX] account_financial_report: allow navigation on all fields Pass res_id correctly to lines to allow navigation on the fields In the open items ledger, the res_id attribute of the invoice in the report was getting: (id, move_name) The result was that, when clicking the line, it would redirect to a new record, instead of the existing. This passes only the id to the line, solving that issue. Fix menu item name TT29371 --- account_financial_report/report/open_items.py | 1 + .../report/templates/open_items.xml | 28 +++++++++++++++---- .../wizard/open_items_wizard_view.xml | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/account_financial_report/report/open_items.py b/account_financial_report/report/open_items.py index 6383dbd4..6e6702fc 100644 --- a/account_financial_report/report/open_items.py +++ b/account_financial_report/report/open_items.py @@ -278,6 +278,7 @@ class OpenItemsReport(models.AbstractModel): "ref_label": ref_label, "journal_id": move_line["journal_id"][0], "move_name": move_line["move_id"][1], + "entry_id": move_line["move_id"][0], "currency_id": move_line["currency_id"][0] if move_line["currency_id"] else False, diff --git a/account_financial_report/report/templates/open_items.xml b/account_financial_report/report/templates/open_items.xml index 4dc057b9..ddefc297 100644 --- a/account_financial_report/report/templates/open_items.xml +++ b/account_financial_report/report/templates/open_items.xml @@ -179,7 +179,7 @@
@@ -188,16 +188,34 @@
- + + +
- + + +
- - + + +
diff --git a/account_financial_report/wizard/open_items_wizard_view.xml b/account_financial_report/wizard/open_items_wizard_view.xml index d8ea48c7..144072c1 100644 --- a/account_financial_report/wizard/open_items_wizard_view.xml +++ b/account_financial_report/wizard/open_items_wizard_view.xml @@ -88,7 +88,7 @@ - Open Itemsr + Open Items open.items.report.wizard form From cb3b0d487b2bf8d9f8efb2db792148223e23a8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 28 Apr 2021 07:44:17 +0100 Subject: [PATCH 2/2] [FIX] account_financial_report: Fix tests Add date to invoice to be able to post --- account_financial_report/tests/test_journal_ledger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_financial_report/tests/test_journal_ledger.py b/account_financial_report/tests/test_journal_ledger.py index 5ebd3abb..e9b642d2 100644 --- a/account_financial_report/tests/test_journal_ledger.py +++ b/account_financial_report/tests/test_journal_ledger.py @@ -237,6 +237,7 @@ class TestJournalReport(AccountTestInvoicingCommon): ) move_form.partner_id = self.partner_2 move_form.journal_id = self.journal_purchase + move_form.invoice_date = Date.today() with move_form.invoice_line_ids.new() as line_form: line_form.name = "test" line_form.quantity = 1.0