Skip to content

Commit

Permalink
Merge pull request OCA#1026 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/social (15.0)
  • Loading branch information
bt-admin authored Jun 8, 2024
2 parents f223599 + 2618b8b commit b8f4cdf
Show file tree
Hide file tree
Showing 22 changed files with 750 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ addon | version | maintainers | summary
[mail_improved_tracking_value](mail_improved_tracking_value/) | 15.0.1.0.0 | | Improves tracking changed values for certain type of fields.Adds a user-friendly view to consult them.
[mail_layout_force](mail_layout_force/) | 15.0.1.0.1 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Force a mail layout on selected email templates
[mail_layout_preview](mail_layout_preview/) | 15.0.0.1.0 | | Preview email templates in the browser
[mail_no_user_assign_notification](mail_no_user_assign_notification/) | 15.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Mail No user Assign Notification
[mail_notification_custom_subject](mail_notification_custom_subject/) | 15.0.1.0.2 | [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) | Apply a custom subject to mail notifications
[mail_optional_autofollow](mail_optional_autofollow/) | 15.0.1.0.0 | | Choose if you want to automatically add new recipients as followers on mail.compose.message
[mail_optional_follower_notification](mail_optional_follower_notification/) | 15.0.1.0.1 | | Choose to notify followers on mail.compose.message
Expand Down
112 changes: 112 additions & 0 deletions mail_no_user_assign_notification/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
================================
Mail No user Assign Notification
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6a4d1334c05ef20496bb328fb7923f2a690c50cf84df26ff96c75edc66bac568
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/15.0/mail_no_user_assign_notification
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_no_user_assign_notification
: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/social&target_branch=15.0
:alt: Try me on Runboat

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

This module inhibits the assignation notification from the models that we want.

**Table of contents**

.. contents::
:local:

Configuration
=============

#. Go to Settings > Technical > System Parameters
#. Edit "mail_no_user_assign_notification.models" key record
#. Set any model* (for example: res.partner).

NOTE1: It is possible to set several models separated by comma (e.g.: model1,model2).

NOTE2: The model should have the field `user_id` for this to be effective.

Usage
=====

#. Go to one of the configured models (like Contacts).
#. Create or edit a record, and assign the field for the user (in contacts, it's called
"Salesperson", in purchase orders it's "Purchase representative", etc).
#. The user won't receive the automatic assignment email.

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

* This is not valid for project tasks users assignation, as the field is multi-relational.
A specific extension would be needed.

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

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

* Víctor Martínez
* Pedro M. Baeza

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

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

|maintainer-victoralmau|

This module is part of the `OCA/social <https://github.com/OCA/social/tree/15.0/mail_no_user_assign_notification>`_ 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 mail_no_user_assign_notification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions mail_no_user_assign_notification/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Mail No user Assign Notification",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"version": "15.0.1.0.0",
"depends": ["mail"],
"license": "AGPL-3",
"category": "Discuss",
"data": ["data/ir_config_parameter.xml"],
"installable": True,
"maintainers": ["victoralmau"],
}
7 changes: 7 additions & 0 deletions mail_no_user_assign_notification/data/ir_config_parameter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="no_user_assign_notification_models" model="ir.config_parameter">
<field name="key">mail_no_user_assign_notification.models</field>
<field name="value" />
</record>
</odoo>
23 changes: 23 additions & 0 deletions mail_no_user_assign_notification/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_no_user_assign_notification
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-30 15:32+0000\n"
"PO-Revision-Date: 2024-05-30 17:33+0200\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: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: mail_no_user_assign_notification
#: model:ir.model,name:mail_no_user_assign_notification.model_mail_thread
msgid "Email Thread"
msgstr "Hilo de mensajes"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_no_user_assign_notification
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \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_no_user_assign_notification
#: model:ir.model,name:mail_no_user_assign_notification.model_mail_thread
msgid "Email Thread"
msgstr ""
3 changes: 3 additions & 0 deletions mail_no_user_assign_notification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import mail_thread
24 changes: 24 additions & 0 deletions mail_no_user_assign_notification/models/mail_thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import models


class MailThread(models.AbstractModel):
_inherit = "mail.thread"

def _message_auto_subscribe_followers(self, updated_values, default_subtype_ids):
"""Remove user_id from updated_values if this model has been set.
This will prevent the user from auto subscrube to records on creation and/or
assignment."""
if updated_values.get("user_id"):
icp = self.sudo().env["ir.config_parameter"]
models_to_skip = icp.get_param(
"mail_no_user_assign_notification.models", ""
)
models_to_skip = [x.strip() for x in models_to_skip.split(",")]
if self._name in models_to_skip:
updated_values.pop("user_id")
return super()._message_auto_subscribe_followers(
updated_values=updated_values, default_subtype_ids=default_subtype_ids
)
7 changes: 7 additions & 0 deletions mail_no_user_assign_notification/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#. Go to Settings > Technical > System Parameters
#. Edit "mail_no_user_assign_notification.models" key record
#. Set any model* (for example: res.partner).

NOTE1: It is possible to set several models separated by comma (e.g.: model1,model2).

NOTE2: The model should have the field `user_id` for this to be effective.
4 changes: 4 additions & 0 deletions mail_no_user_assign_notification/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
1 change: 1 addition & 0 deletions mail_no_user_assign_notification/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module inhibits the assignation notification from the models that we want.
2 changes: 2 additions & 0 deletions mail_no_user_assign_notification/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* This is not valid for project tasks users assignation, as the field is multi-relational.
A specific extension would be needed.
4 changes: 4 additions & 0 deletions mail_no_user_assign_notification/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#. Go to one of the configured models (like Contacts).
#. Create or edit a record, and assign the field for the user (in contacts, it's called
"Salesperson", in purchase orders it's "Purchase representative", etc).
#. The user won't receive the automatic assignment email.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b8f4cdf

Please sign in to comment.