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.

27 lines
844 B

  1. # -*- coding: utf-8 -*-
  2. # © 2015 Grupo ESOC
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp.tests.common import TransactionCase
  5. class CompanyCase(TransactionCase):
  6. model = "res.partner"
  7. context = {"default_is_company": True}
  8. def test_computing_after_unlink(self):
  9. """Test what happens if recomputed after unlinking.
  10. This test might seem useless, but really this happens when module
  11. ``partner_relations`` is installed.
  12. See https://github.com/OCA/partner-contact/issues/154.
  13. """
  14. data = {"name": u"Söme name", "birthdate": "2015-09-28"}
  15. record = self.env[self.model].with_context(**self.context).create(data)
  16. record.unlink()
  17. record.recompute()
  18. class PersonCase(CompanyCase):
  19. context = {"default_is_company": False}