You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

  1. # Author: Julien Coux
  2. # Copyright 2016 Camptocamp SA
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.addons.account.tests.common import AccountTestInvoicingCommon
  5. class TestOpenItems(AccountTestInvoicingCommon):
  6. @classmethod
  7. def setUpClass(cls, chart_template_ref=None):
  8. super().setUpClass(chart_template_ref=chart_template_ref)
  9. def test_partner_filter(self):
  10. partner_1 = self.env.ref("base.res_partner_1")
  11. partner_2 = self.env.ref("base.res_partner_2")
  12. partner_3 = self.env.ref("base.res_partner_3")
  13. partner_4 = self.env.ref("base.res_partner_4")
  14. partner_1.write({"is_company": False, "parent_id": partner_2.id})
  15. partner_3.write({"is_company": False})
  16. expected_list = [partner_2.id, partner_3.id, partner_4.id]
  17. context = {
  18. "active_ids": [partner_1.id, partner_2.id, partner_3.id, partner_4.id],
  19. "active_model": "res.partner",
  20. }
  21. wizard = self.env["open.items.report.wizard"].with_context(context)
  22. self.assertEqual(wizard._default_partners(), expected_list)