-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] mail_activity_multiple_users module
- Loading branch information
1 parent
0ad6eda
commit 9b8bcb9
Showing
17 changed files
with
820 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
============================ | ||
Mail Activity Multiple Users | ||
============================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:19cd5d81e4016b286acd3e8ca8183f39ea255d15f758291399341c5a81744226 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/16.0/mail_activity_multiple_users | ||
:alt: OCA/social | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_activity_multiple_users | ||
: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=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This addon allows to create several activities for several users at once, if needded. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To create activities for several users at once check 'Multiple users activity?' on the activities form, during creation. From there, select the users to which the activities will be assigned. | ||
|
||
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_activity_multiple_users%0Aversion:%2016.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 | ||
~~~~~~~ | ||
|
||
* Binhex | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Binhex <https://binhex.cloud>`_: | ||
|
||
* Ariel Barreiros <[email protected]> | ||
|
||
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 <https://github.com/OCA/social/tree/16.0/mail_activity_multiple_users>`_ 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,16 @@ | ||
# Copyright 2024 Binhex (<https://binhex.cloud>) | ||
# Copyright 2024 Binhex Ariel Barreiros | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
{ | ||
"name": "Mail Activity Multiple Users", | ||
"summary": """This module allows to create several | ||
activities for several users at once, if needded""", | ||
"version": "16.0.1.0.0", | ||
"category": "Social Network", | ||
"author": "Binhex, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/social", | ||
"license": "AGPL-3", | ||
"depends": ["mail"], | ||
"data": ["views/mail_activity_view.xml"], | ||
"installable": True, | ||
} |
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,58 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_activity_multiple_users | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-05 08:13+0000\n" | ||
"PO-Revision-Date: 2024-07-05 08: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_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,help:mail_activity_multiple_users.field_mail_activity__user_ids | ||
#, python-format | ||
msgid "Activities will be created for this list of users" | ||
msgstr "Se crearán actividades para esta lista de usuarios" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model,name:mail_activity_multiple_users.model_mail_activity | ||
msgid "Activity" | ||
msgstr "Actividad" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__user_ids | ||
#, python-format | ||
msgid "Assigned Users" | ||
msgstr "Usuarios asignados" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__display_name | ||
msgid "Display Name" | ||
msgstr "Nombre mostrado" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity____last_update | ||
msgid "Last Modified on" | ||
msgstr "Última modificación el" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__is_multiple_users_activity | ||
#, python-format | ||
msgid "Multiple users activity?" | ||
msgstr "¿Actividad de varios usuarios?" |
57 changes: 57 additions & 0 deletions
57
mail_activity_multiple_users/i18n/mail_activity_multiple_users.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,57 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_activity_multiple_users | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-05 08:13+0000\n" | ||
"PO-Revision-Date: 2024-07-05 08:13+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_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,help:mail_activity_multiple_users.field_mail_activity__user_ids | ||
#, python-format | ||
msgid "Activities will be created for this list of users" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model,name:mail_activity_multiple_users.model_mail_activity | ||
msgid "Activity" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__user_ids | ||
#, python-format | ||
msgid "Assigned Users" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: mail_activity_multiple_users | ||
#: code:addons/mail_activity_multiple_users/models/mail_activity.py:0 | ||
#: model:ir.model.fields,field_description:mail_activity_multiple_users.field_mail_activity__is_multiple_users_activity | ||
#, python-format | ||
msgid "Multiple users activity?" | ||
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 @@ | ||
from . import mail_activity |
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,49 @@ | ||
# Copyright 2024 Binhex (<https://binhex.cloud>) | ||
# Copyright 2024 Binhex Ariel Barreiros | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class MailActivity(models.Model): | ||
_inherit = "mail.activity" | ||
|
||
def _default_is_module_calendar_installed(self): | ||
module = self.env["ir.module.module"].sudo().search([("name", "=", "calendar")]) | ||
return True if module and module.state == "installed" else False | ||
|
||
user_ids = fields.Many2many( | ||
"res.users", | ||
string="Assigned Users", | ||
help="Activities will be created for this list of users", | ||
) | ||
is_multiple_users_activity = fields.Boolean(string="Multiple users activity?") | ||
is_module_calendar_installed = fields.Boolean( | ||
readonly=True, default=_default_is_module_calendar_installed | ||
) | ||
|
||
@api.model_create_multi | ||
def _create(self, values): | ||
res = super(MailActivity, self)._create(values) | ||
if res.user_id in res.user_ids: | ||
res.user_ids = [(3, res.user_id.id)] | ||
if res.is_multiple_users_activity: | ||
res.is_multiple_users_activity = False | ||
for user in res.user_ids: | ||
self.create( | ||
{ | ||
"res_model_id": res.res_model_id.id, | ||
"res_id": res.res_id, | ||
"activity_type_id": res.activity_type_id.id, | ||
"date_deadline": res.date_deadline, | ||
"user_id": user.id, | ||
"summary": res.summary, | ||
"note": res.note, | ||
} | ||
) | ||
return res | ||
|
||
@api.onchange("user_ids") | ||
def _onchange_user_ids(self): | ||
if self.user_ids: | ||
self.user_id = self.user_ids[0] |
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 @@ | ||
* `Binhex <https://binhex.cloud>`_: | ||
|
||
* Ariel Barreiros <[email protected]> |
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 addon allows to create several activities for several users at once, if needded. |
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 @@ | ||
To create activities for several users at once check 'Multiple users activity?' on the activities form, during creation. From there, select the users to which the activities will be assigned. |
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.