Browse Source
[MIG] partner_contact_job_position
[MIG] partner_contact_job_position
* Changed icon * Change author and web * Check recursionpull/328/head
cubells
8 years ago
committed by
Pedro M. Baeza
10 changed files with 125 additions and 102 deletions
-
11partner_contact_job_position/README.rst
-
7partner_contact_job_position/__init__.py
-
14partner_contact_job_position/__openerp__.py
-
7partner_contact_job_position/models/__init__.py
-
16partner_contact_job_position/models/res_partner.py
-
BINpartner_contact_job_position/static/description/icon.png
-
5partner_contact_job_position/tests/__init__.py
-
30partner_contact_job_position/tests/test_recursion.py
-
20partner_contact_job_position/views/res_partner_job_position_view.xml
-
19partner_contact_job_position/views/res_partner_view.xml
@ -1,9 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) |
|||
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> |
|||
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) |
|||
# Antonio Espinosa <antonioea@antiun.com> |
|||
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis |
|||
# © 2014-2016 Tecnativa S.L. - Jairo Llopis |
|||
# © 2016 Tecnativa S.L. - Vicent Cubells |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import models |
@ -1,9 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) |
|||
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> |
|||
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) |
|||
# Antonio Espinosa <antonioea@antiun.com> |
|||
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis |
|||
# © 2014-2016 Tecnativa S.L. - Jairo Llopis |
|||
# © 2016 Tecnativa S.L. - Vicent Cubells |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import res_partner |
Before Width: 128 | Height: 128 | Size: 22 KiB After Width: 128 | Height: 128 | Size: 11 KiB |
@ -0,0 +1,5 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Vicent Cubells |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). |
|||
|
|||
from . import test_recursion |
@ -0,0 +1,30 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Tecnativa - Vicent Cubells |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). |
|||
from openerp.tests import common |
|||
from openerp.exceptions import ValidationError |
|||
|
|||
|
|||
class TestRecursion(common.SavepointCase): |
|||
|
|||
@classmethod |
|||
def setUpClass(cls): |
|||
super(TestRecursion, cls).setUpClass() |
|||
cls.job_obj = cls.env['res.partner.job_position'] |
|||
|
|||
# Instances |
|||
cls.grand_parent = cls.job_obj.create(vals=dict(name='Grand parent')) |
|||
cls.parent = cls.job_obj.create(vals=dict( |
|||
name='Parent', |
|||
parent_id=cls.grand_parent.id |
|||
)) |
|||
|
|||
def test_recursion(self): |
|||
""" Testing recursion """ |
|||
self.child = self.job_obj.create(vals=dict( |
|||
name='Grand parent', |
|||
parent_id=self.parent.id |
|||
)) |
|||
# Creating a parent's child using grand-parent |
|||
with self.assertRaises(ValidationError): |
|||
self.grand_parent.write(vals={'parent_id': self.child.id}) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue