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
130 changes: 130 additions & 0 deletions mail_activity_plan_domain/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
Mail Activity Plan Domain
=========================

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

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

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

This module extends Odoo's activity plan feature with domain-based
filtering at two levels:

**Plan domain**

Each activity plan gains a *Domain* field. Only records matching this
domain will have the plan available in the scheduling wizard
(``mail.activity.schedule``). This lets you restrict plans to, for
example, company-type partners or records in a specific stage.

**Template domain**

Each line of an activity plan (template) gains its own *Domain* field.
When executing a plan, activities whose template domain does not match
the target record are silently skipped. This allows a single plan to
cover heterogeneous records while still generating only the relevant
activities per record.

**Notes**

- The error preview shown in the scheduling wizard (missing responsible,
etc.) deliberately ignores template domains so that all potential
configuration issues remain visible.
- When scheduling a plan on multiple records, execution is serialized
record by record so that each record is evaluated independently
against both plan and template domains.
- Domain syntax follows the standard Odoo domain format, e.g.
``[('is_company', '=', True)]``.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module:

1. Go to **Discuss > Configuration > Activity Plans**.
2. Open or create an activity plan.
3. In the **Domain** field, set the domain that records must match for
this plan to appear in the scheduling wizard (e.g.
``[('is_company', '=', True)]`` to restrict the plan to company-type
partners). Leave empty or use ``[]`` to apply to all records.
4. In the plan lines, each activity template also has its own **Domain**
field. Set it to skip that activity for records that do not match
(e.g. ``[('is_company', '=', False)]`` to schedule an activity only
for individual contacts). Leave empty or use ``[]`` to always
schedule the activity.

When scheduling a plan from a record, only plans whose **Domain**
matches that record will be listed. During execution, activities whose
template domain does not match the record are silently skipped.

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

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

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

- Cristina Hidalgo

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/mail <https://github.com/OCA/mail/tree/17.0/mail_activity_plan_domain>`_ 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 mail_activity_plan_domain/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
16 changes: 16 additions & 0 deletions mail_activity_plan_domain/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Mail Activity Plan Domain",
"summary": "Apply domain filters to activity plans and their templates",
"version": "17.0.1.0.0",
"development_status": "Beta",
"category": "Discuss",
"website": "https://github.com/OCA/mail",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["mail"],
"data": [
"views/mail_activity_plan_views.xml",
"views/mail_activity_plan_template_views.xml",
],
}
63 changes: 63 additions & 0 deletions mail_activity_plan_domain/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_activity_plan_domain
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-15 13:13+0000\n"
"PO-Revision-Date: 2026-04-15 13:13+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_plan
msgid "Activity Plan"
msgstr "Plan de actividad"

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_plan_template
msgid "Activity plan template"
msgstr "Plantilla del plan de actividad"

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_schedule
msgid "Activity schedule plan Wizard"
msgstr "Asistente para planificar actividades"

#. module: mail_activity_plan_domain
#: model:ir.model.fields,field_description:mail_activity_plan_domain.field_mail_activity_plan__domain
#: model:ir.model.fields,field_description:mail_activity_plan_domain.field_mail_activity_plan_template__domain
msgid "Domain"
msgstr "Dominio"

#. module: mail_activity_plan_domain
#: model:ir.model.fields,help:mail_activity_plan_domain.field_mail_activity_plan_template__domain
msgid ""
"Domain to filter the records for which this activity will be scheduled. "
"Leave empty or use '[]' to always schedule this activity."
msgstr ""
"Dominio para filtrar los registros para los que se programará esta "
"actividad. Déjelo vacío o use '[]' para programar siempre esta actividad."

#. module: mail_activity_plan_domain
#: model:ir.model.fields,help:mail_activity_plan_domain.field_mail_activity_plan__domain
msgid ""
"Domain to filter the records on which this plan is applicable. Leave empty "
"or use '[]' to apply to all records of the target model."
msgstr ""
"Dominio para filtrar los registros a los que es aplicable este plan. "
"Déjelo vacío o use '[]' para aplicarlo a todos los registros del modelo."

#. module: mail_activity_plan_domain
#. odoo-python
#: code:addons/mail_activity_plan_domain/models/mail_activity_schedule.py:0
#, python-format
msgid "Launch Plans"
msgstr "Lanzar planes"
58 changes: 58 additions & 0 deletions mail_activity_plan_domain/i18n/mail_activity_plan_domain.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_activity_plan_domain
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-15 13:12+0000\n"
"PO-Revision-Date: 2026-04-15 13:12+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_plan
msgid "Activity Plan"
msgstr ""

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_plan_template
msgid "Activity plan template"
msgstr ""

#. module: mail_activity_plan_domain
#: model:ir.model,name:mail_activity_plan_domain.model_mail_activity_schedule
msgid "Activity schedule plan Wizard"
msgstr ""

#. module: mail_activity_plan_domain
#: model:ir.model.fields,field_description:mail_activity_plan_domain.field_mail_activity_plan__domain
#: model:ir.model.fields,field_description:mail_activity_plan_domain.field_mail_activity_plan_template__domain
msgid "Domain"
msgstr ""

#. module: mail_activity_plan_domain
#: model:ir.model.fields,help:mail_activity_plan_domain.field_mail_activity_plan_template__domain
msgid ""
"Domain to filter the records for which this activity will be scheduled. "
"Leave empty or use '[]' to always schedule this activity."
msgstr ""

#. module: mail_activity_plan_domain
#: model:ir.model.fields,help:mail_activity_plan_domain.field_mail_activity_plan__domain
msgid ""
"Domain to filter the records on which this plan is applicable. Leave empty "
"or use '[]' to apply to all records of the target model."
msgstr ""

#. module: mail_activity_plan_domain
#. odoo-python
#: code:addons/mail_activity_plan_domain/models/mail_activity_schedule.py:0
#, python-format
msgid "Launch Plans"
msgstr ""
2 changes: 2 additions & 0 deletions mail_activity_plan_domain/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import mail_activity_plan
from . import mail_activity_plan_template
11 changes: 11 additions & 0 deletions mail_activity_plan_domain/models/mail_activity_plan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class MailActivityPlan(models.Model):
_inherit = "mail.activity.plan"

domain = fields.Char(
default="[]",
help="Domain to filter the records on which this plan is applicable. "
"Leave empty or use '[]' to apply to all records of the target model.",
)
11 changes: 11 additions & 0 deletions mail_activity_plan_domain/models/mail_activity_plan_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class MailActivityPlanTemplate(models.Model):
_inherit = "mail.activity.plan.template"

domain = fields.Char(
default="[]",
help="Domain to filter the records for which this activity will be "
"scheduled. Leave empty or use '[]' to always schedule this activity.",
)
3 changes: 3 additions & 0 deletions mail_activity_plan_domain/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions mail_activity_plan_domain/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Tecnativa](https://www.tecnativa.com):
- Cristina Hidalgo
27 changes: 27 additions & 0 deletions mail_activity_plan_domain/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This module extends Odoo's activity plan feature with domain-based filtering at
two levels:

**Plan domain**

Each activity plan gains a *Domain* field. Only records matching this domain
will have the plan available in the scheduling wizard
(`mail.activity.schedule`). This lets you restrict plans to, for example,
company-type partners or records in a specific stage.

**Template domain**

Each line of an activity plan (template) gains its own *Domain* field. When
executing a plan, activities whose template domain does not match the target
record are silently skipped. This allows a single plan to cover heterogeneous
records while still generating only the relevant activities per record.

**Notes**

- The error preview shown in the scheduling wizard (missing responsible,
etc.) deliberately ignores template domains so that all potential
configuration issues remain visible.
- When scheduling a plan on multiple records, execution is serialized
record by record so that each record is evaluated independently against
both plan and template domains.
- Domain syntax follows the standard Odoo domain format,
e.g. `[('is_company', '=', True)]`.
17 changes: 17 additions & 0 deletions mail_activity_plan_domain/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To use this module:

1. Go to **Discuss > Configuration > Activity Plans**.
2. Open or create an activity plan.
3. In the **Domain** field, set the domain that records must match for this
plan to appear in the scheduling wizard
(e.g. `[('is_company', '=', True)]` to restrict the plan to company-type
partners). Leave empty or use `[]` to apply to all records.
4. In the plan lines, each activity template also has its own **Domain** field.
Set it to skip that activity for records that do not match
(e.g. `[('is_company', '=', False)]` to schedule an activity only for
individual contacts). Leave empty or use `[]` to always schedule the
activity.

When scheduling a plan from a record, only plans whose **Domain** matches that
record will be listed. During execution, activities whose template domain does
not match the record are silently skipped.
Loading
Loading