Browse Source

[FIX] partner_multi_relation_hierarchy. Improvements after review.

pull/508/head
Ronald Portier 7 years ago
parent
commit
9e64f2427a
  1. 13
      partner_multi_relation_hierarchy/README.rst
  2. 9
      partner_multi_relation_hierarchy/__manifest__.py
  3. 2
      partner_multi_relation_hierarchy/models/__init__.py
  4. 6
      partner_multi_relation_hierarchy/models/res_partner_relation_hierarchy.py
  5. 4
      partner_multi_relation_hierarchy/models/res_partner_relation_type.py
  6. 4
      partner_multi_relation_hierarchy/tests/test_partner_hierarchy.py

13
partner_multi_relation_hierarchy/README.rst

@ -7,12 +7,14 @@ Partner Multi Relation Hierarchy
This module extends the concept of relations between partners with the concept This module extends the concept of relations between partners with the concept
of an hierarchy. of an hierarchy.
For istance a company belonging to a larger concern would have the concern 'above' it.
For istance a company belonging to a larger concern would have the concern
'above' it.
Or a person might belong to a local organisation, that in turn might belong to a
provincial organisation, which might belong to a nation organisation.
Or a person might belong to a local organisation, that in turn might belong
to a provincial organisation, which might belong to a nation organisation.
It will not be excluded that a partner might be connected to several hierarchies.
It will not be excluded that a partner might be connected to several
hierarchies.
The hierarchical 'chains' will be made visible on the partner. The hierarchical 'chains' will be made visible on the partner.
@ -23,9 +25,6 @@ For further information, please visit:
* https://www.odoo.com/forum/help-1 * https://www.odoo.com/forum/help-1
Known issues / Roadmap
======================
Credits Credits
======= =======

9
partner_multi_relation_hierarchy/__manifest__.py

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Therp BV <https://therp.nl>
# Copyright 2017-2018 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Partner relation hierarchy",
"name": "Partner Relation Hierarchy",
"version": "10.0.0.1.0", "version": "10.0.0.1.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"website": "https://github.com/oca/partner-contact",
"author": "Therp BV, Odoo Community Association (OCA)",
"complexity": "normal", "complexity": "normal",
"category": "Customer Relationship Management", "category": "Customer Relationship Management",
"license": "AGPL-3", "license": "AGPL-3",
@ -12,9 +13,9 @@
"partner_multi_relation", "partner_multi_relation",
], ],
"data": [ "data": [
'security/ir.model.access.csv',
'views/res_partner.xml', 'views/res_partner.xml',
'views/res_partner_relation_type.xml', 'views/res_partner_relation_type.xml',
'security/ir.model.access.csv',
], ],
"auto_install": False, "auto_install": False,
"installable": True, "installable": True,

2
partner_multi_relation_hierarchy/models/__init__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Therp BV <https://therp.nl>
# Copyright 2017 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import res_partner_relation_type from . import res_partner_relation_type
from . import res_partner_relation_hierarchy from . import res_partner_relation_hierarchy

6
partner_multi_relation_hierarchy/models/res_partner_relation_hierarchy.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Therp BV <https://therp.nl>
# Copyright 2017-2018 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
"""Abstract model to show each relation from two sides.""" """Abstract model to show each relation from two sides."""
from psycopg2.extensions import AsIs from psycopg2.extensions import AsIs
from openerp import api, fields, models
from openerp.tools import drop_view_if_exists
from odoo import api, fields, models
from odoo.tools import drop_view_if_exists
class ResPartnerRelationHierarchy(models.AbstractModel): class ResPartnerRelationHierarchy(models.AbstractModel):

4
partner_multi_relation_hierarchy/models/res_partner_relation_type.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Therp BV <https://therp.nl>
# Copyright 2017-2018 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
from odoo import fields, models
HIERARCHY_SELECTION = [ HIERARCHY_SELECTION = [

4
partner_multi_relation_hierarchy/tests/test_partner_hierarchy.py

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Therp BV # Copyright 2017 Therp BV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.exceptions import ValidationError
from openerp.tests import common
from odoo.exceptions import ValidationError
from odoo.tests import common
class TestPartnerHierarchy(common.TransactionCase): class TestPartnerHierarchy(common.TransactionCase):

Loading…
Cancel
Save