forked from OCA/social
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OCA#1026 from OCA/15.0
Syncing from upstream OCA/social (15.0)
- Loading branch information
Showing
22 changed files
with
750 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
7
mail_no_user_assign_notification/data/ir_config_parameter.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
19 changes: 19 additions & 0 deletions
19
mail_no_user_assign_notification/i18n/mail_no_user_assign_notification.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.