diff --git a/README.md b/README.md index 2189b9f95..0617bf2d3 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ addon | version | summary [partner_contact_nationality](partner_contact_nationality/) | 8.0.1.0.0 | Contact's nationality [partner_contact_personal_information_page](partner_contact_personal_information_page/) | 8.0.1.0.0 | Add a page to contacts form to put personal information [partner_external_maps](partner_external_maps/) | 8.0.0.1.0 | Add Map and Map Routing buttons on partner form to open GMaps, OSM, Bing and others -[partner_firstname](partner_firstname/) | 8.0.2.0.0 | Split first name and last name for non company partners +[partner_firstname](partner_firstname/) | 8.0.2.0.1 | Split first name and last name for non company partners [partner_helper](partner_helper/) | 8.0.0.1.0 | Partner Helper [partner_relations](partner_relations/) | 8.0.1.1.0 | Partner relations [partner_second_lastname](partner_second_lastname/) | 8.0.4.0.0 | Partner second last name diff --git a/partner_contact_birthdate/tests/__init__.py b/partner_contact_birthdate/tests/__init__.py index 73d8cb813..b3374a537 100644 --- a/partner_contact_birthdate/tests/__init__.py +++ b/partner_contact_birthdate/tests/__init__.py @@ -16,4 +16,4 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import test_birthdate +from . import test_birthdate, test_delete diff --git a/partner_contact_birthdate/tests/test_delete.py b/partner_contact_birthdate/tests/test_delete.py new file mode 100644 index 000000000..d3d4666d8 --- /dev/null +++ b/partner_contact_birthdate/tests/test_delete.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# © 2015 Grupo ESOC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase + + +class CompanyCase(TransactionCase): + model = "res.partner" + context = {"default_is_company": True} + + def test_computing_after_unlink(self): + """Test what happens if recomputed after unlinking. + + This test might seem useless, but really this happens when module + ``partner_relations`` is installed. + + See https://github.com/OCA/partner-contact/issues/154. + """ + data = {"name": u"Söme name", "birthdate": "2015-09-28"} + record = self.env[self.model].with_context(**self.context).create(data) + record.unlink() + record.recompute() + + +class PersonCase(CompanyCase): + context = {"default_is_company": False} diff --git a/partner_firstname/__openerp__.py b/partner_firstname/__openerp__.py index 8738becd4..9fb02c998 100644 --- a/partner_firstname/__openerp__.py +++ b/partner_firstname/__openerp__.py @@ -21,12 +21,13 @@ { 'name': 'Partner first name and last name', 'summary': "Split first name and last name for non company partners", - 'version': '8.0.2.0.1', + 'version': '8.0.2.1.0', 'author': "Camptocamp, Grupo ESOC, Odoo Community Association (OCA)", "license": "AGPL-3", 'maintainer': 'Camptocamp, Acsone', 'category': 'Extra Tools', - 'website': 'http://www.camptocamp.com, http://www.acsone.eu', + 'website': + 'http://www.camptocamp.com, http://www.acsone.eu, http://grupoesoc.es', 'depends': ['base'], 'data': [ 'views/res_partner.xml', diff --git a/partner_firstname/tests/__init__.py b/partner_firstname/tests/__init__.py index 2bdf39b05..b1ca17cbc 100644 --- a/partner_firstname/tests/__init__.py +++ b/partner_firstname/tests/__init__.py @@ -29,4 +29,11 @@ # ############################################################################## -from . import test_create, test_defaults, test_empty, test_name, test_onchange +from . import ( + test_create, + test_delete, + test_defaults, + test_empty, + test_name, + test_onchange +) diff --git a/partner_firstname/tests/test_delete.py b/partner_firstname/tests/test_delete.py new file mode 100644 index 000000000..0729502f1 --- /dev/null +++ b/partner_firstname/tests/test_delete.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# © 2015 Grupo ESOC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase +from .base import MailInstalled + + +class CompanyCase(TransactionCase): + model = "res.partner" + context = {"default_is_company": True} + + def test_computing_after_unlink(self): + """Test what happens if recomputed after unlinking. + + This test might seem useless, but really this happens when module + ``partner_relations`` is installed. + + See https://github.com/OCA/partner-contact/issues/154. + """ + data = {"name": u"Söme name"} + record = self.env[self.model].with_context(**self.context).create(data) + record.unlink() + record.recompute() + + +class PersonCase(CompanyCase): + context = {"default_is_company": False} + + +class UserCase(CompanyCase, MailInstalled): + model = "res.users" + context = {"default_login": "user@example.com"} + + def test_computing_after_unlink(self): + # Cannot create users if ``mail`` is installed + if not self.mail_installed(): + super(UserCase, self).test_computing_after_unlink()