diff --git a/partner_archive_propagate/README.rst b/partner_archive_propagate/README.rst
index 11bfc8ba82c..0f8e4fa9b71 100644
--- a/partner_archive_propagate/README.rst
+++ b/partner_archive_propagate/README.rst
@@ -67,15 +67,56 @@ Configuration
Usage
=====
+Archiving a partner
+-------------------
+
+This module provides two distinct ways to archive a company or parent contact.
+
+Archive via the action menu (gear icon)
+---------------------------------------
+
+Clicking **Archive** in the gear (⚙) menu archives **only the company
+itself**. Child contacts, invoice/delivery addresses, and related partners
+are left completely untouched. Use this when you want a quick archive
+without touching any of the company's contacts.
+
+.. note::
+
+ This behaviour is consistent regardless of the *Force propagation
+ outside UI* system setting. The gear menu never propagates.
+
+Archive via the "Archive Contact and Children" button
+-----------------------------------------------------
+
1. Open a partner (company or main contact).
2. Click the **"Archive Contact and Children"** button.
-3. Review the list of child contacts to be archived.
-4. Confirm the action.
- * Non-contact types (e.g., invoice/delivery addresses) are archived silently.
+3. Review the list of child contacts to be archived. Remove any row to
+ keep that contact active after archiving.
+4. Confirm the action.
+
+ * Non-contact types (e.g., invoice/delivery addresses) are archived
+ silently in the background — they do not appear in the list.
* Contact-type descendants appear in the wizard for review.
+ * Contacts linked to active users are automatically excluded from the
+ list; a warning message is posted on the company.
+
+If the company has no contact-type descendants, no wizard opens and the
+company (and its non-contact addresses) are archived immediately.
+
+Unarchiving
+-----------
+
+Unarchiving also follows propagation rules: if a parent partner is
+unarchived, its propagated descendants are unarchived as well. Partners
+that were independently archived are not affected.
+
+System setting: Force propagation outside UI
+--------------------------------------------
-Unarchiving also follows propagation rules:
-if a parent partner is unarchived, its propagated descendants are unarchived as well.
+When **Force propagation outside UI** is enabled (under *Settings*),
+archiving a company via any non-UI path (imports, RPC calls, automated
+jobs, etc.) will also propagate to descendants, just as the wizard button
+does. This setting has no effect on the gear menu action.
Bug Tracker
===========
diff --git a/partner_archive_propagate/models/res_partner.py b/partner_archive_propagate/models/res_partner.py
index cd84281210e..9354a5d9ec1 100644
--- a/partner_archive_propagate/models/res_partner.py
+++ b/partner_archive_propagate/models/res_partner.py
@@ -203,3 +203,11 @@ def action_archive_with_contacts(self):
"target": "new",
"res_id": wiz.id,
}
+
+ def action_archive(self):
+ """Archive only this partner via gear
+ Do not super, otherwise core odoo
+ archives children too
+ """
+ self.filtered("active").write({"active": False})
+ return False
diff --git a/partner_archive_propagate/readme/USAGE.rst b/partner_archive_propagate/readme/USAGE.rst
index 78c97822e94..c85e7423620 100644
--- a/partner_archive_propagate/readme/USAGE.rst
+++ b/partner_archive_propagate/readme/USAGE.rst
@@ -1,9 +1,50 @@
+Archiving a partner
+-------------------
+
+This module provides two distinct ways to archive a company or parent contact.
+
+Archive via the action menu (gear icon)
+---------------------------------------
+
+Clicking **Archive** in the gear (⚙) menu archives **only the company
+itself**. Child contacts, invoice/delivery addresses, and related partners
+are left completely untouched. Use this when you want a quick archive
+without touching any of the company's contacts.
+
+.. note::
+
+ This behaviour is consistent regardless of the *Force propagation
+ outside UI* system setting. The gear menu never propagates.
+
+Archive via the "Archive Contact and Children" button
+-----------------------------------------------------
+
1. Open a partner (company or main contact).
2. Click the **"Archive Contact and Children"** button.
-3. Review the list of child contacts to be archived.
-4. Confirm the action.
- * Non-contact types (e.g., invoice/delivery addresses) are archived silently.
+3. Review the list of child contacts to be archived. Remove any row to
+ keep that contact active after archiving.
+4. Confirm the action.
+
+ * Non-contact types (e.g., invoice/delivery addresses) are archived
+ silently in the background — they do not appear in the list.
* Contact-type descendants appear in the wizard for review.
+ * Contacts linked to active users are automatically excluded from the
+ list; a warning message is posted on the company.
+
+If the company has no contact-type descendants, no wizard opens and the
+company (and its non-contact addresses) are archived immediately.
+
+Unarchiving
+-----------
+
+Unarchiving also follows propagation rules: if a parent partner is
+unarchived, its propagated descendants are unarchived as well. Partners
+that were independently archived are not affected.
+
+System setting: Force propagation outside UI
+--------------------------------------------
-Unarchiving also follows propagation rules:
-if a parent partner is unarchived, its propagated descendants are unarchived as well.
+When **Force propagation outside UI** is enabled (under *Settings*),
+archiving a company via any non-UI path (imports, RPC calls, automated
+jobs, etc.) will also propagate to descendants, just as the wizard button
+does. This setting has no effect on the gear menu action.
diff --git a/partner_archive_propagate/static/description/index.html b/partner_archive_propagate/static/description/index.html
index e4ccc47169e..3bb5d10e52e 100644
--- a/partner_archive_propagate/static/description/index.html
+++ b/partner_archive_propagate/static/description/index.html
@@ -397,13 +397,6 @@
Features
+
+
+
Archiving a partner
+
This module provides two distinct ways to archive a company or parent contact.
+
+
+
+
+
Unarchiving
+
Unarchiving also follows propagation rules: if a parent partner is
+unarchived, its propagated descendants are unarchived as well. Partners
+that were independently archived are not affected.
+
+
System setting: Force propagation outside UI
+
When Force propagation outside UI is enabled (under Settings),
+archiving a company via any non-UI path (imports, RPC calls, automated
+jobs, etc.) will also propagate to descendants, just as the wizard button
+does. This setting has no effect on the gear menu action.
-
+
Bug Tracker
Bugs are tracked on GitHub 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
@@ -436,21 +467,21 @@
Do not contact contributors directly about support or help with technical issues.
-
+
Credits
-
+
Maintainers
This module is maintained by the OCA.
diff --git a/partner_archive_propagate/tests/test_archive.py b/partner_archive_propagate/tests/test_archive.py
index b8c3a9dcbd6..508cb67322e 100644
--- a/partner_archive_propagate/tests/test_archive.py
+++ b/partner_archive_propagate/tests/test_archive.py
@@ -241,3 +241,30 @@ def test_wizard_deleted_line_not_archived(self):
# B was removed from the list and must remain as it was
self.assertTrue(self.B.active)
self.assertFalse(bool(self.B.propagated_from_id))
+
+ def test_action_archive_gear_leaves_contacts_untouched(self):
+ """action_archive archives only self.
+ Contact-type children are left untouched ."""
+ for p in (self.A, self.B, self.C, self.D, self.E):
+ p.write({"active": True, "propagated_from_id": False})
+ result = self.A.action_archive()
+ self.assertFalse(result)
+ self.assertFalse(self.A.active)
+ # All descendants left untouched
+ self.assertTrue(self.B.active)
+ self.assertTrue(self.C.active)
+ self.assertTrue(self.D.active)
+ self.assertTrue(self.E.active)
+
+ def test_action_archive_gear_no_contacts_still_only_archives_company(self):
+ """action_archive archives only the company even when there
+ are no contact-type candidates."""
+ self.B.write({"active": False})
+ self.E.write({"active": False})
+ for p in (self.A, self.C, self.D):
+ p.write({"active": True, "propagated_from_id": False})
+ result = self.A.action_archive()
+ self.assertFalse(result)
+ self.assertFalse(self.A.active)
+ self.assertTrue(self.C.active)
+ self.assertTrue(self.D.active)
diff --git a/partner_archive_propagate/wizard/archive_propagate_wizard.py b/partner_archive_propagate/wizard/archive_propagate_wizard.py
index f7ddcd17546..a460daa5396 100644
--- a/partner_archive_propagate/wizard/archive_propagate_wizard.py
+++ b/partner_archive_propagate/wizard/archive_propagate_wizard.py
@@ -19,9 +19,10 @@ def action_confirm(self):
- skip descendants linked to active users and notify
"""
self.ensure_one()
- self.partner_id.with_context(partner_archive_propagate_ui=True).write(
- {"active": False}
- )
+ self.partner_id.with_context(
+ partner_archive_propagate_ui=True,
+ archive_propagate_wizard_line_ids=self.line_ids.mapped("partner_id").ids,
+ ).write({"active": False})
partners = (
self.line_ids.mapped("partner_id").sudo().filtered(lambda p: p.active)
)