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.

30 lines
1.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # © 2015 ACSONE SA/NV (<http://acsone.eu>).
  3. # © 2016 syscoon GmbH (<http://syscoon.com>).
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. import openerp.tests.common as common
  6. class TestBasePartnerSequence(common.TransactionCase):
  7. def test_ref_sequence_on_partner(self):
  8. res_partner = self.env['res.partner']
  9. partner_customer = res_partner.create({
  10. 'name': "Customer Test",
  11. 'email': "customer@test.com",
  12. 'customer': True})
  13. self.assertTrue(partner_customer.ref, "A customer has always a ref.")
  14. copy = partner_customer.copy()
  15. self.assertTrue(copy.ref, "A customer with ref created by copy "
  16. "has a ref by default.")
  17. partner_supplier = res_partner.create({
  18. 'name': "Supplier Test",
  19. 'email': "supplier@test.com"})
  20. self.assertTrue(partner_supplier.ref, "A supplier has always a ref.")
  21. copy = partner_supplier.copy()
  22. self.assertTrue(copy.ref, "A supplier with ref created by copy "
  23. "has a ref by default.")