diff --git a/message_auto_subscribe_notify_own/README.rst b/message_auto_subscribe_notify_own/README.rst new file mode 100644 index 00000000..880987b7 --- /dev/null +++ b/message_auto_subscribe_notify_own/README.rst @@ -0,0 +1,87 @@ +================================= +Message Auto Subscribe Notify Own +================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/11.0/message_auto_subscribe_notify_own + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-11-0/social-11-0-message_auto_subscribe_notify_own + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/205/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +With this module you will receive a notification when you assign yourself +to an object that has a responsible user, like the salesperson in +leads/opportunities. + +In general Odoo will notify other users in this situation, but not the own +user who has performed the action. + +But in certain situations it is better that you receive this notification, as +a reminder sent to your mailbox that you are now responsible for that object. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Assign yourself as salesperson of a lead/opportunity, for example, and you +will see that you'll receive a notification. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Eficent + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester Alomar + +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/social `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/message_auto_subscribe_notify_own/__init__.py b/message_auto_subscribe_notify_own/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/message_auto_subscribe_notify_own/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/message_auto_subscribe_notify_own/__manifest__.py b/message_auto_subscribe_notify_own/__manifest__.py new file mode 100644 index 00000000..fdc837db --- /dev/null +++ b/message_auto_subscribe_notify_own/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Aleph Objects, Inc. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +{ + "name": "Message Auto Subscribe Notify Own", + "summary": "Receive notifications of your own subscriptions", + "version": "11.0.1.0.0", + "category": "Social Network", + "website": "https://github.com/OCA/social", + "author": "Eficent, " + "Odoo Community Association (OCA)", + "license": "LGPL-3", + "installable": True, + "depends": [ + "mail", + ], +} diff --git a/message_auto_subscribe_notify_own/models/__init__.py b/message_auto_subscribe_notify_own/models/__init__.py new file mode 100644 index 00000000..b70a9f2d --- /dev/null +++ b/message_auto_subscribe_notify_own/models/__init__.py @@ -0,0 +1 @@ +from . import mail_thread diff --git a/message_auto_subscribe_notify_own/models/mail_thread.py b/message_auto_subscribe_notify_own/models/mail_thread.py new file mode 100644 index 00000000..b930ba21 --- /dev/null +++ b/message_auto_subscribe_notify_own/models/mail_thread.py @@ -0,0 +1,25 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Aleph Objects, Inc. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, models + + +class MailThread(models.AbstractModel): + _inherit = 'mail.thread' + + @api.multi + def message_auto_subscribe(self, updated_fields, values=None): + super(MailThread, self).message_auto_subscribe(updated_fields, + values=values) + user_field_lst = self._message_get_auto_subscribe_fields( + updated_fields) + to_add_users = self.env['res.users'].sudo().browse( + [values[name] for name in user_field_lst if values.get(name)] + ).filtered(lambda u: u.partner_id.active) + user_pids = [user.partner_id.id for user in to_add_users + if user == self.env.user and + user.notification_type == 'email'] + if user_pids: + self._message_auto_subscribe_notify(user_pids) + return True diff --git a/message_auto_subscribe_notify_own/readme/CONTRIBUTORS.rst b/message_auto_subscribe_notify_own/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..6860affe --- /dev/null +++ b/message_auto_subscribe_notify_own/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Jordi Ballester Alomar diff --git a/message_auto_subscribe_notify_own/readme/DESCRIPTION.rst b/message_auto_subscribe_notify_own/readme/DESCRIPTION.rst new file mode 100644 index 00000000..2a74c7da --- /dev/null +++ b/message_auto_subscribe_notify_own/readme/DESCRIPTION.rst @@ -0,0 +1,9 @@ +With this module you will receive a notification when you assign yourself +to an object that has a responsible user, like the salesperson in +leads/opportunities. + +In general Odoo will notify other users in this situation, but not the own +user who has performed the action. + +But in certain situations it is better that you receive this notification, as +a reminder sent to your mailbox that you are now responsible for that object. \ No newline at end of file diff --git a/message_auto_subscribe_notify_own/readme/USAGE.rst b/message_auto_subscribe_notify_own/readme/USAGE.rst new file mode 100644 index 00000000..d84ee238 --- /dev/null +++ b/message_auto_subscribe_notify_own/readme/USAGE.rst @@ -0,0 +1,2 @@ +Assign yourself as salesperson of a lead/opportunity, for example, and you +will see that you'll receive a notification. diff --git a/message_auto_subscribe_notify_own/static/description/icon.png b/message_auto_subscribe_notify_own/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/message_auto_subscribe_notify_own/static/description/icon.png differ diff --git a/message_auto_subscribe_notify_own/static/description/index.html b/message_auto_subscribe_notify_own/static/description/index.html new file mode 100644 index 00000000..e3b3aecb --- /dev/null +++ b/message_auto_subscribe_notify_own/static/description/index.html @@ -0,0 +1,409 @@ + + + + + + +Message Auto Subscribe Notify Own + + + +
+

Message Auto Subscribe Notify Own

+ + +

Beta License: LGPL-3 OCA/social Translate me on Weblate Try me on Runbot

+

With this module you will receive a notification when you assign yourself +to an object that has a responsible user, like the salesperson in +leads/opportunities.

+

In general Odoo will notify other users in this situation, but not the own +user who has performed the action.

+

But in certain situations it is better that you receive this notification, as +a reminder sent to your mailbox that you are now responsible for that object.

+

Table of contents

+ +
+

Usage

+

Assign yourself as salesperson of a lead/opportunity, for example, and you +will see that you’ll receive a notification.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/social project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +