[FIX] account_financial_report: Print report with details

This commit is contained in:
SimoRubi
2021-08-23 17:01:52 +02:00
committed by chaule97
parent 87d23aab50
commit e0a41eca2d
5 changed files with 65 additions and 30 deletions

View File

@@ -1,6 +1,7 @@
# ?? 2016 Julien Coux (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from . import test_aged_partner_balance
from . import test_general_ledger
from . import test_journal_ledger
from . import test_open_items

View File

@@ -0,0 +1,34 @@
# Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import TransactionCase
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, test_reports
class TestAgedPartnerBalance(TransactionCase):
def setUp(self):
super().setUp()
self.wizard_model = self.env["aged.partner.balance.report.wizard"]
def test_report(self):
"""Check that report is produced correctly."""
wizard = self.wizard_model.create(
{
"show_move_line_details": True,
"receivable_accounts_only": True,
}
)
wizard.onchange_type_accounts_only()
data = wizard._prepare_report_aged_partner_balance()
# Simulate web client behavior:
# default value is a datetime.date but web client sends back strings
data.update({"date_at": data["date_at"].strftime(DEFAULT_SERVER_DATE_FORMAT)})
result = test_reports.try_report(
self.env.cr,
self.env.uid,
"account_financial_report.aged_partner_balance",
wizard.ids,
data=data,
)
self.assertTrue(result)