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.

29 lines
1.1 KiB

  1. # Copyright 2016 Tecnativa - Carlos Dauden
  2. # Copyright 2017 Tecnativa - Pedro M. Baeza
  3. # Copyright 2018 Roel Adriaans - roel@road-support.nl
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from odoo.addons.contract.tests.test_contract import TestContractBase
  6. class TestContract(TestContractBase):
  7. @classmethod
  8. def setUpClass(cls):
  9. # Reuse the tests from the contract module, but replace the
  10. # contract line
  11. super(TestContract, cls).setUpClass()
  12. cls.acct_line.unlink()
  13. cls.line_vals.update({
  14. 'display_type': 'line_section',
  15. })
  16. cls.acct_line = cls.env['account.analytic.invoice.line'].create(
  17. cls.line_vals,
  18. )
  19. def test_create_invoice(self):
  20. """ Create contract with section"""
  21. self.contract.recurring_create_invoice()
  22. invoice_id = self.env['account.invoice'].search(
  23. [('contract_id', '=', self.contract.id)])
  24. self.assertEqual(invoice_id.invoice_line_ids.display_type,
  25. self.line_vals['display_type'])