mirror of
https://gitlab.com/flectra-community/account-financial-reporting.git
synced 2024-11-22 21:52:05 +00:00
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
# Author: Julien Coux
|
|
# Copyright 2016 Camptocamp SA
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from flectra.tests import tagged
|
|
|
|
from flectra.addons.account.tests.common import AccountTestInvoicingCommon
|
|
|
|
|
|
@tagged("post_install", "-at_install")
|
|
class TestOpenItems(AccountTestInvoicingCommon):
|
|
@classmethod
|
|
def setUpClass(cls, chart_template_ref=None):
|
|
super().setUpClass(chart_template_ref=chart_template_ref)
|
|
|
|
def test_partner_filter(self):
|
|
partner_1 = self.env.ref("base.res_partner_1")
|
|
partner_2 = self.env.ref("base.res_partner_2")
|
|
partner_3 = self.env.ref("base.res_partner_3")
|
|
partner_4 = self.env.ref("base.res_partner_4")
|
|
partner_1.write({"is_company": False, "parent_id": partner_2.id})
|
|
partner_3.write({"is_company": False})
|
|
|
|
expected_list = [partner_2.id, partner_3.id, partner_4.id]
|
|
context = {
|
|
"active_ids": [partner_1.id, partner_2.id, partner_3.id, partner_4.id],
|
|
"active_model": "res.partner",
|
|
}
|
|
|
|
wizard = self.env["open.items.report.wizard"].with_context(context)
|
|
self.assertEqual(wizard._default_partners(), expected_list)
|