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.

24 lines
809 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 Tecnativa - David Vidal
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo.tests import common
  5. class TestPartnerRiskInsurance(common.SavepointCase):
  6. @classmethod
  7. def setUpClass(cls):
  8. super(TestPartnerRiskInsurance, cls).setUpClass()
  9. cls.partner = cls.env['res.partner'].create({
  10. 'name': 'Mr. Odoo',
  11. })
  12. def test_compute_credit(self):
  13. self.partner.company_credit_limit = 1000.0
  14. self.partner.insurance_credit_limit = 3000.0
  15. self.partner._onchage_insurance_credit_limit()
  16. self.assertEqual(self.partner.credit_limit, 4000.0)
  17. # Set credit limit manually:
  18. self.partner.credit_limit = 1500.0
  19. self.assertEqual(self.partner.credit_limit, 1500.0)