Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] partner_multi_relation: Migration to 18.0 #1933

Open
wants to merge 44 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a9f06ec
[MIG] partner_multi_relation: Migration to 10.0
NL66278 Dec 28, 2016
0570219
[FIX] partner_multi_relation: Several fixes:
gurneyalex Apr 6, 2017
fa88324
[IMP] Menu order and v10 deprecations
chienandalu May 30, 2017
2686fb9
[FIX] partner_multi_relation: Fix errors on searches
pedrobaeza Sep 14, 2017
2d840f5
[IMP] Make partner_multi_relation more extendable.
NL66278 Oct 16, 2017
a63805e
[FIX] partner_multi_relation. Drop is_inverse from vals on creation o…
NL66278 Feb 9, 2018
960457c
[FIX] partner_multi_relation. Wrong self instead of this.
NL66278 Feb 13, 2018
439a780
[MIG] partner_multi_relation: Migration to 11.0
ddufresne Feb 26, 2018
8f12d10
[FIX] partner_multi_relation. Extendable but threadsafe.
NL66278 Apr 12, 2018
e1a10a5
[MIG] partner_multi_relation: Continue migration to 11.0
ddufresne Apr 16, 2018
d07868b
Migrate partner_multi_relation to version 12.0
Nov 14, 2018
a965750
Translated using Weblate (Spanish)
Galoperd Nov 10, 2019
01442bb
[FIX] Context Errors With Active ID
osi-scampbell Mar 7, 2020
d979b69
[IMP] Formatting
osi-scampbell Apr 27, 2020
53b0b8a
[FIX] remove import statements for tests
skeller1 Apr 28, 2020
a663e78
[IMP] Flake8
osi-scampbell Apr 28, 2020
4eb375d
[FIX] partner_multi_relation: fix unlinking of record sets with same …
skeller1 Apr 29, 2020
3e10a65
[FIX] partner_multi_relation (Smart Button Error)
patrickrwilson May 5, 2020
8b3f32d
[UPD] Attempt at manipulating context
patrickrwilson May 6, 2020
a008c64
[FIX] Contact ID Error
patrickrwilson May 15, 2020
92d147a
Translated using Weblate (Italian)
SicurSam May 11, 2020
6fe2139
[MIG] partner_multi_relation. Black, isort, pretty...
NL66278 Jul 6, 2020
aa2ded0
[MIG] partner_multi_relation. Actual 13.0 migration.
NL66278 Jul 6, 2020
f19b0f8
[FIX] Fixing problems with migration of computed fields with search f…
Sep 28, 2020
5ecf7c3
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 8, 2020
49f8e1f
[IMP] partner_multi_relation: black, isort
rven Apr 28, 2021
60dc61e
[MIG] partner_multi_relation: Migration to 14.0
rven Apr 28, 2021
ab4c8dc
[FIX] partner_multi_relation: Avoid access error on Relations button
Oct 1, 2021
0eb0084
Translated using Weblate (Portuguese)
pedrocs-exo Nov 10, 2021
a59fcee
[MIG] partner_multi_relation: Migration to 15.0
Mar 3, 2022
d2b0c67
[MIG] partner_multi_relation: Migration to 16.0
weblate Dec 2, 2022
ff46c46
Translated using Weblate (Croatian)
badbole Jan 30, 2023
28c0c25
Translated using Weblate (Italian)
mymage Mar 23, 2023
ebad457
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
b9526e6
Translated using Weblate (Spanish)
Ivorra78 Aug 22, 2023
1ea0c81
Translated using Weblate (Italian)
mymage Sep 22, 2023
5cf21cd
[IMP] partner_multi_relation: pre-commit stuff
Feb 14, 2024
472e082
[MIG] partner_multi_relation: Migration to 17.0
Feb 14, 2024
9371a27
[UPD] Update partner_multi_relation.pot
Apr 22, 2024
c15e12d
Update translation files
weblate Apr 22, 2024
aa4dbaf
Translated using Weblate (Swedish)
jakobkrabbe Jun 5, 2024
6d180bd
[IMP] partner_contact_role: pre-commit execution
jdidderen-nsi Aug 7, 2024
a6b2d03
[IMP] partner_multi_relation: pre-commit auto fixes
BT-mchechlacz Nov 12, 2024
b33bfc9
[MIG] partner_multi_relation: Migration to 18.0
BT-mchechlacz Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 228 additions & 0 deletions partner_multi_relation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
=================
Partner Relations
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f4895f23ab68ab38eb0f9d9d1e2cd942e4a663a44835bb25431aab75ff3152c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/18.0/partner_multi_relation
:alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_multi_relation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module aims to provide generic means to model relations between
partners.

Examples would be 'is sibling of' or 'is friend of', but also 'has
contract X with' or 'is assistant of'. This way, you can encode your
knowledge about your partners directly in your partner list.

**Table of contents**

.. contents::
:local:

Usage
=====

Relation Types
--------------

Before being able to use relations, you'll have define some first. Do
that in Contacts / Relations / Partner relations.

|image|

A relation type has a name for both sides.

|image1|

To have an assistant-relation, you would name one side 'is assistant of'
and the other side 'has assistant'.

|image2|

Partner Types
-------------

The Partner Type fields allow to constrain what type of partners can be
used on the left and right sides of the relation.

- In the example above, the assistant-relation only makes sense between
people, so you would choose 'Person' for both partner types.

|image3|

- For a relation 'is a competitor of', both sides would be companies.
- A relation 'has worked for' should have persons on the left side and
companies on the right side.

If you leave these fields empty, the relation is applicable to all types
of partners.

Partner Categories
------------------

You may use categories (tags) to further specify the type of partners.

You could for example enforce the 'is member of' relation to accept only
companies with the label 'Organization' on the right side.

|image4|

Reflexive
---------

A reflexive relation type allows a partner to be in relation with
himself.

For example, the CEO of a company could be his own manager.

|image5|

Symmetric
---------

A symetric relation has the same value for the left and right sides.

For example, in a competitor relation, both companies are competitors of
each other.

|image6|

Invalid Relation Handling
-------------------------

When the configuration of a relation type changes, some relations
between 2 partners may become invalid.

For example, if the left partner type is set to Person and a relation
already exists with a company on the right side, that relation becomes
invalid.

|image7|

What happens with invalid relations is customizable on the relation
type.

4 possible behaviors are available:

- Do not allow change that will result in invalid relations
- Allow existing relations that do not fit changed conditions
- End relations per today, if they do not fit changed conditions
- Delete relations that do not fit changed conditions

Searching Partners With Relations
---------------------------------

To search for existing relations, go to Contacts / Relations /
Relations.

|image8|

To find all assistants in your database, fill in 'assistant' and
autocomplete will propose to search for this type of relation.

|image9|

Now if you want to find Colleen's assistant, you fill in 'Colleen' and
one of the proposals is to search for partners having a relation with
Colleen.

|image10|

Searching Relations From Partner View
-------------------------------------

A smart button is available on the partner form view to display the list
of relations.

|image11|

|image12|

.. |image| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_list.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_form_empty.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_form_name_filled.png
.. |image3| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_form_partner_type_filled.png
.. |image4| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_form_category_filled.png
.. |image5| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_reflexive.png
.. |image6| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_symmetric.png
.. |image7| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/relation_type_invalid_handling.png
.. |image8| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/search_relation.png
.. |image9| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/search_relation_2.png
.. |image10| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/search_relation_3.png
.. |image11| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/partner_form_view_smart_button.png
.. |image12| image:: https://raw.githubusercontent.com/OCA/partner-contact/12.0/partner_multi_relation/static/description/partner_form_view_smart_button_2.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_multi_relation%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Therp BV
* Camptocamp

Contributors
------------

- Holger Brunn <[email protected]>
- Stefan Rijnhart <[email protected]>
- Ronald Portier <[email protected]>
- Sandy Carter <[email protected]>
- Bruno Joliveau <[email protected]>
- Adriana Ierfino <[email protected]>
- Numigi (tm) and all its contributors (https://bit.ly/numigiens)
- Radovan Skolnik <[email protected]>, KEMA SK s.r.o.
(https://www.kema.sk)
- `DynApps NV <https://www.dynapps.be>`__:

- Raf Ven

- Marcin Chechłacz <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/18.0/partner_multi_relation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions partner_multi_relation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
22 changes: 22 additions & 0 deletions partner_multi_relation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2013-2022 Therp BV <http://therp.nl>.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Relations",
"version": "18.0.1.0.0",
"author": "Therp BV,Camptocamp,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"complexity": "normal",
"category": "Customer Relationship Management",
"license": "AGPL-3",
"depends": ["contacts", "sales_team"],
"demo": ["data/demo.xml"],
"data": [
"security/ir.model.access.csv",
"views/res_partner_relation_all.xml",
"views/res_partner.xml",
"views/res_partner_relation_type.xml",
"views/menu.xml",
],
"auto_install": False,
"installable": True,
}
106 changes: 106 additions & 0 deletions partner_multi_relation/data/demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Added partner categories and partners to this file, because it
turned out to be a bad idea to rely on demo data in base module,
that can change from release to release. Only dependency on
countries remain. They are less likely to change/disappear.
-->
<!-- Partner relation types -->
<record id="rel_type_assistant" model="res.partner.relation.type">
<field name="name">Is assistant of</field>
<field name="name_inverse">Has assistant</field>
<field name="contact_type_left">p</field>
<field name="contact_type_right">p</field>
</record>
<record id="rel_type_competitor" model="res.partner.relation.type">
<field name="name">Is competitor of</field>
<field name="name_inverse">Is competitor of</field>
<field name="contact_type_left">c</field>
<field name="contact_type_right">c</field>
<field name="is_symmetric" eval="True" />
</record>
<record id="rel_type_has_worked_for" model="res.partner.relation.type">
<field name="name">Has worked for</field>
<field name="name_inverse">Has former employee</field>
<field name="contact_type_left">p</field>
<field name="contact_type_right">c</field>
</record>
<!-- Categories -->
<record id="res_partner_category_pmr_0" model="res.partner.category">
<field name="name">Washing Companies</field>
</record>
<record id="res_partner_category_pmr_4" model="res.partner.category">
<field name="name">Washing Gold</field>
<field name="parent_id" ref="res_partner_category_pmr_0" />
</record>
<record id="res_partner_category_pmr_5" model="res.partner.category">
<field name="name">Washing Silver</field>
<field name="parent_id" ref="res_partner_category_pmr_0" />
</record>
<record id="res_partner_category_pmr_11" model="res.partner.category">
<field name="name">Washing Services</field>
<field name="parent_id" ref="res_partner_category_pmr_0" />
</record>
<!-- Partners -->
<record id="res_partner_pmr_great" model="res.partner">
<field name="name">Great Washing Powder Company</field>
<field
name="category_id"
eval="[(6, 0, [ref('res_partner_category_pmr_11'), ref('res_partner_category_pmr_4')])]"
/>
<field name="is_company">1</field>
<field name="city">Le Bourget du Lac</field>
<field name="zip">73377</field>
<field name="phone">+33 4 49 23 44 54</field>
<field name="country_id" ref="base.fr" />
<field name="street">93, Press Avenue</field>
<field name="email">[email protected]</field>
<field name="website">http://www.great.com</field>
</record>
<record id="res_partner_pmr_best" model="res.partner">
<field name="name">Best Washing Powder Company</field>
<field
name="category_id"
eval="[(6, 0, [ref('res_partner_category_pmr_4'), ref('res_partner_category_pmr_11')])]"
/>
<field name="is_company">1</field>
<field name="city">Champs sur Marne</field>
<field name="zip">77420</field>
<field name="country_id" ref="base.fr" />
<field name="email">[email protected]</field>
<field name="phone">+33 1 64 61 04 01</field>
<field name="street">12 rue Albert Einstein</field>
<field name="website">http://www.best.com/</field>
</record>
<record id="res_partner_pmr_super" model="res.partner">
<field name="name">Super Washing Powder Company</field>
<field name="category_id" eval="[(6,0,[ref('res_partner_category_pmr_5')])]" />
<field name="is_company">1</field>
<field name="street">3rd Floor, Room 3-C,</field>
<field
name="street2"
>Carretera Panamericana, Km 1, Urb. Delgado Chalbaud</field>
<field name="city">Caracas</field>
<field name="zip">1090</field>
<field name="email">[email protected]</field>
<field name="phone">+58 212 681 0538</field>
<field name="country_id" ref="base.ve" />
<field name="website">super.com</field>
</record>
<!-- Relations -->
<record id="rel_1" model="res.partner.relation">
<field name="left_partner_id" ref="res_partner_pmr_great" />
<field name="right_partner_id" ref="res_partner_pmr_super" />
<field name="type_id" ref="rel_type_competitor" />
</record>
<record id="rel_2" model="res.partner.relation">
<field name="left_partner_id" ref="res_partner_pmr_best" />
<field name="right_partner_id" ref="res_partner_pmr_super" />
<field name="type_id" ref="rel_type_competitor" />
</record>
<record id="rel_3" model="res.partner.relation">
<field name="left_partner_id" ref="res_partner_pmr_great" />
<field name="right_partner_id" ref="res_partner_pmr_best" />
<field name="type_id" ref="rel_type_competitor" />
</record>
</odoo>
Loading
Loading