Skip to content

Commit bedfbf7

Browse files
committed
Merge PR #147 into 18.0
Signed-off-by pedrobaeza
2 parents 5938470 + 1800c60 commit bedfbf7

19 files changed

Lines changed: 774 additions & 0 deletions
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
================================
2+
Mail No user Assign Notification
3+
================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:6c92038441171972dbb95e3ac02db0ce3b006a4157f7370390fbd10ff9bd1893
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
20+
:target: https://github.com/OCA/mail/tree/18.0/mail_no_user_assign_notification
21+
:alt: OCA/mail
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_no_user_assign_notification
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module inhibits the assignation notification from the models that
32+
we want.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Configuration
40+
=============
41+
42+
1. Go to Settings > Technical > System Parameters
43+
2. Edit "mailno_user_assign_notification.models" key record
44+
3. Set any model\* (for example: res.partner).
45+
46+
NOTE1: It is possible to set several models separated by comma (e.g.:
47+
model1,model2).
48+
49+
NOTE2: The model should have the field user_id for this to be effective.
50+
51+
Usage
52+
=====
53+
54+
1. Go to one of the configured models (like Contacts).
55+
2. Create or edit a record, and assign the field for the user (in
56+
contacts, it's called "Salesperson", in purchase orders it's
57+
"Purchase representative", etc).
58+
3. The user won't receive the automatic assignment email.
59+
60+
Known issues / Roadmap
61+
======================
62+
63+
- This is not valid for project tasks users assignation, as the field is
64+
multi-relational. A specific extension would be needed.
65+
66+
Bug Tracker
67+
===========
68+
69+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
70+
In case of trouble, please check there if your issue has already been reported.
71+
If you spotted it first, help us to smash it by providing a detailed and welcomed
72+
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_no_user_assign_notification%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
73+
74+
Do not contact contributors directly about support or help with technical issues.
75+
76+
Credits
77+
=======
78+
79+
Authors
80+
-------
81+
82+
* Tecnativa
83+
84+
Contributors
85+
------------
86+
87+
- `Tecnativa <https://www.tecnativa.com>`__:
88+
89+
- Víctor Martínez
90+
- Pedro M. Baeza
91+
92+
Maintainers
93+
-----------
94+
95+
This module is maintained by the OCA.
96+
97+
.. image:: https://odoo-community.org/logo.png
98+
:alt: Odoo Community Association
99+
:target: https://odoo-community.org
100+
101+
OCA, or the Odoo Community Association, is a nonprofit organization whose
102+
mission is to support the collaborative development of Odoo features and
103+
promote its widespread use.
104+
105+
.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
106+
:target: https://github.com/victoralmau
107+
:alt: victoralmau
108+
109+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
110+
111+
|maintainer-victoralmau|
112+
113+
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_no_user_assign_notification>`_ project on GitHub.
114+
115+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Tecnativa - Víctor Martínez
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Mail No user Assign Notification",
5+
"author": "Tecnativa, Odoo Community Association (OCA)",
6+
"website": "https://github.com/OCA/mail",
7+
"version": "18.0.1.0.0",
8+
"depends": ["mail"],
9+
"license": "AGPL-3",
10+
"category": "Discuss",
11+
"data": ["data/ir_config_parameter.xml"],
12+
"installable": True,
13+
"maintainers": ["victoralmau"],
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="no_user_assign_notification_models" model="ir.config_parameter">
4+
<field name="key">mail_no_user_assign_notification.models</field>
5+
<field name="value" />
6+
</record>
7+
</odoo>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * mail_no_user_assign_notification
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-05-30 15:32+0000\n"
10+
"PO-Revision-Date: 2024-05-30 17:33+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: \n"
18+
"X-Generator: Poedit 3.0.1\n"
19+
20+
#. module: mail_no_user_assign_notification
21+
#: model:ir.model,name:mail_no_user_assign_notification.model_mail_thread
22+
msgid "Email Thread"
23+
msgstr "Hilo de mensajes"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * mail_no_user_assign_notification
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2025-04-05 08:50+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.10.2\n"
18+
19+
#. module: mail_no_user_assign_notification
20+
#: model:ir.model,name:mail_no_user_assign_notification.model_mail_thread
21+
msgid "Email Thread"
22+
msgstr "Discussione e-mail"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * mail_no_user_assign_notification
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: mail_no_user_assign_notification
17+
#: model:ir.model,name:mail_no_user_assign_notification.model_mail_thread
18+
msgid "Email Thread"
19+
msgstr ""
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import mail_thread
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2024 Tecnativa - Víctor Martínez
2+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3+
4+
from odoo import models
5+
6+
7+
class MailThread(models.AbstractModel):
8+
_inherit = "mail.thread"
9+
10+
def _message_auto_subscribe_followers(self, updated_values, default_subtype_ids):
11+
"""Remove user_id from updated_values if this model has been set.
12+
This will prevent the user from auto subscrube to records on creation and/or
13+
assignment."""
14+
if updated_values.get("user_id"):
15+
icp = self.sudo().env["ir.config_parameter"]
16+
models_to_skip = icp.get_param(
17+
"mail_no_user_assign_notification.models", ""
18+
)
19+
models_to_skip = [x.strip() for x in models_to_skip.split(",")]
20+
if self._name in models_to_skip:
21+
updated_values.pop("user_id")
22+
return super()._message_auto_subscribe_followers(
23+
updated_values=updated_values, default_subtype_ids=default_subtype_ids
24+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

0 commit comments

Comments
 (0)