Metadata-Version: 2.1
Name: odoo-addon-partner_multi_relation_archive_propagate
Version: 16.0.1.1.0
Summary: Propagate archiving via partner_multi_relation relations
Home-page: https://github.com/OCA/partner-contact
Author: Therp BV, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-partner-archive-propagate<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-partner-multi-relation<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

========================================
Partner Multi Relation Archive Propagate
========================================

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

.. |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/license-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/16.0/partner_multi_relation_archive_propagate
    :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-16-0/partner-contact-16-0-partner_multi_relation_archive_propagate
    :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=16.0
    :alt: Try me on Runboat

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

=========================================
Partner Multi Relation Archive Propagate
=========================================

This module extends the behaviour of
`partner_archive_propagate` to also propagate archiving and
unarchiving **via partner_multi_relation relations**.

When a company is archived:

* all related partners linked through relation types with
  ``propagate_archive = True`` are considered for propagation;
* related partners without active users are archived and marked with
  ``propagated_from_id`` pointing to the company;
* related partners linked to active users are skipped and listed in a
  message on the company.

When the company is unarchived, all partners that were archived because
of it – whether through the partner hierarchy or through
multi-relations – are restored automatically by the core
`partner_archive_propagate` logic.

Non-company partners do not propagate via this module, even if they are
involved in relations with ``propagate_archive = True``.

**Table of contents**

.. contents::
   :local:

Usage
=====

1. Install the following modules:

   * ``partner_multi_relation``
   * ``partner_archive_propagate``
   * ``partner_multi_relation_archive_propagate`` (this module)

2. Configure relation types:

   * Go to *Relation Types* menu.
   * Create or edit a relation type.
   * Enable **"Propagate archive"** (``propagate_archive``) on the
     relation type(s) where archiving should cascade.

3. Create relations:

   * Link a company partner to other partners using the configured
     relation types.

4. Archive a company:

   * Use the **"Archive Contact and Children"** button (not the gear menu)
     to propagate archiving to related partners.
   * The wizard lists both hierarchy contacts and contact-type relation
     partners. Remove any row to exclude that partner from the operation.
   * All related partners reachable via relation types with
     ``propagate_archive = True`` will be treated like propagated
     descendants:

     * archived if possible,
     * skipped (and mentioned) if they have active users,
     * marked with ``propagated_from_id = <company>``.

   .. note::

      The gear (⚙) **Archive** action archives only the company itself
      and never propagates to relation partners, regardless of the
      *Force propagation outside UI* setting.

5. Unarchive the company:

   * Unarchiving the company triggers the base
     ``partner_archive_propagate`` logic.
   * All partners (tree descendants or relation-based) that were archived
     because of this company (``propagated_from_id``) are unarchived and
     have the field cleared.

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_archive_propagate%0Aversion:%2016.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

Contributors
~~~~~~~~~~~~

* Nikos Tsirintanis <ntsirintanis@therp.nl>

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.

.. |maintainer-ntsirintanis| image:: https://github.com/ntsirintanis.png?size=40px
    :target: https://github.com/ntsirintanis
    :alt: ntsirintanis

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ntsirintanis| 

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
