Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
117 changes: 117 additions & 0 deletions mass_mailing_partner_subscription/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================================
Mass Mailing Partner Subscription
=================================

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

.. |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%2Fmass--mailing-lightgray.png?logo=github
:target: https://github.com/OCA/mass-mailing/tree/19.0/mass_mailing_partner_subscription
:alt: OCA/mass-mailing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mass-mailing-19-0/mass-mailing-19-0-mass_mailing_partner_subscription
: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/mass-mailing&target_branch=19.0
:alt: Try me on Runboat

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

This module allows managing a partner's mailing list subscriptions
directly from the partner form, without navigating to the mailing
contact.

Features
--------

- A **Mailing Lists** field is shown on the partner form (Sales &
Purchase tab), visible to mailing users.
- Editing the field updates the subscriptions of the linked mailing
contact.
- If the partner has no mailing contact yet, one is automatically
created when mailing lists are first assigned.

**Table of contents**

.. contents::
:local:

Usage
=====

Open a partner form and navigate to the **Sales & Purchase** tab. The
**Mailing Lists** field shows the mailing lists the partner is currently
subscribed to.

Add or remove lists directly from this field. Changes are immediately
reflected on the linked mailing contact. If the partner is not yet
linked to a mailing contact, one is created automatically on the first
assignment.

Known issues / Roadmap
======================

Known Issues
------------

- When a partner is linked to more than one mailing contact, only the
first contact's subscriptions are displayed and edited. Lists
belonging to other linked contacts are not visible in the partner
form.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mass-mailing/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/mass-mailing/issues/new?body=module:%20mass_mailing_partner_subscription%0Aversion:%2019.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
-------

* ForgeFlow

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

- `ForgeFlow <https://www.forgeflow.com>`__:

- Aaron Henriquez

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/mass-mailing <https://github.com/OCA/mass-mailing/tree/19.0/mass_mailing_partner_subscription>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mass_mailing_partner_subscription/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions mass_mailing_partner_subscription/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Mass Mailing Partner Subscription",
"summary": "Manage mailing list subscriptions directly from the partner form",
"version": "19.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mass-mailing",
"license": "AGPL-3",
"category": "Marketing",
"depends": ["mass_mailing_partner"],
"data": ["views/res_partner_views.xml"],
"installable": True,
}
1 change: 1 addition & 0 deletions mass_mailing_partner_subscription/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
39 changes: 39 additions & 0 deletions mass_mailing_partner_subscription/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

mailing_list_ids = fields.Many2many(
comodel_name="mailing.list",
string="Mailing Lists",
compute="_compute_mailing_list_ids",
inverse="_inverse_mailing_list_ids",
compute_sudo=True,
)

@api.depends("mass_mailing_contact_ids", "mass_mailing_contact_ids.list_ids")
def _compute_mailing_list_ids(self):
for partner in self:
contact = partner.mass_mailing_contact_ids[:1]
partner.mailing_list_ids = contact.list_ids

def _inverse_mailing_list_ids(self):
MailingContact = self.env["mailing.contact"].sudo()
for partner in self:
lists = partner.mailing_list_ids
contact = partner.sudo().mass_mailing_contact_ids[:1]
if not contact:
if not lists:
continue
contact = MailingContact.create(
{
"name": partner.name,
"email": partner.email,
"partner_id": partner.id,
}
)
contact.list_ids = lists
3 changes: 3 additions & 0 deletions mass_mailing_partner_subscription/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions mass_mailing_partner_subscription/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [ForgeFlow](https://www.forgeflow.com):

> - Aaron Henriquez
10 changes: 10 additions & 0 deletions mass_mailing_partner_subscription/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This module allows managing a partner's mailing list subscriptions directly
from the partner form, without navigating to the mailing contact.

## Features

- A **Mailing Lists** field is shown on the partner form (Sales & Purchase tab),
visible to mailing users.
- Editing the field updates the subscriptions of the linked mailing contact.
- If the partner has no mailing contact yet, one is automatically created when
mailing lists are first assigned.
5 changes: 5 additions & 0 deletions mass_mailing_partner_subscription/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Known Issues

- When a partner is linked to more than one mailing contact, only the first
contact's subscriptions are displayed and edited. Lists belonging to other
linked contacts are not visible in the partner form.
7 changes: 7 additions & 0 deletions mass_mailing_partner_subscription/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Open a partner form and navigate to the **Sales & Purchase** tab. The
**Mailing Lists** field shows the mailing lists the partner is currently
subscribed to.

Add or remove lists directly from this field. Changes are immediately
reflected on the linked mailing contact. If the partner is not yet linked
to a mailing contact, one is created automatically on the first assignment.
Loading
Loading