Browse Source
Merge pull request #200 from eLBati/fix_bug_154
Merge pull request #200 from eLBati/fix_bug_154
FIX when partner_contact_birthdate and partner_relations are installa…pull/209/head
Pedro M. Baeza
9 years ago
9 changed files with 100 additions and 34 deletions
-
2partner_contact_birthdate/tests/__init__.py
-
27partner_contact_birthdate/tests/test_delete.py
-
5partner_firstname/__openerp__.py
-
9partner_firstname/tests/__init__.py
-
38partner_firstname/tests/test_delete.py
-
11partner_relations/__openerp__.py
-
39partner_relations/model/res_partner.py
-
2partner_relations/model/res_partner_relation_type_selection.py
-
1partner_relations/tests/test_partner_relations.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} |
@ -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() |
Write
Preview
Loading…
Cancel
Save
Reference in new issue