Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] base_automation_team_activity #957

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions base_automation_team_activity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=============================
Base Automation Team Activity
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9edd6734fb63585bb30d837a2790deab0eb651be53cd6e7dee21f1d096f9826a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/14.0/base_automation_team_activity
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-14-0/server-ux-14-0-base_automation_team_activity
: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/server-ux&target_branch=14.0
:alt: Try me on Runboat

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

This add-on allows the creation of team activities using Odoo's automated action.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

To use this add-on, you just need to change the "Activity User Type"
field to "team" and select the group you want to use.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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/server-ux/issues/new?body=module:%20base_automation_team_activity%0Aversion:%2014.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://www.binhex.cloud>_`:

* Adasat Torres de León <[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.

.. |maintainer-adasatorres| image:: https://github.com/adasatorres.png?size=40px
:target: https://github.com/adasatorres
:alt: adasatorres

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

|maintainer-adasatorres|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/14.0/base_automation_team_activity>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions base_automation_team_activity/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2024 Binhex - Adasat Torres
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
18 changes: 18 additions & 0 deletions base_automation_team_activity/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Binhex - Adasat Torres
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Base Automation Team Activity",
"summary": "Add team activity support to base_automation",
"category": "Tools",
"development_status": "Alpha",
"version": "14.0.1.0.0",
"depends": ["base_automation", "mail_activity_team"],
"data": [
"views/ir_actions_server_views.xml",
],
"author": "Binhex, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-ux",
"license": "AGPL-3",
"installable": True,
"maintainers": ["adasatorres"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_automation_team_activity
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0-20231106\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 11:59+0000\n"
"PO-Revision-Date: 2024-10-21 11:59+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: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_base_automation__activity_user_type
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__activity_user_type
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_cron__activity_user_type
msgid "Activity User Type"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__display_name
msgid "Display Name"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__id
msgid "ID"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server____last_update
msgid "Last Modified on"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model,name:base_automation_team_activity.model_ir_actions_server
msgid "Server Action"
msgstr ""

#. module: base_automation_team_activity
#: code:addons/base_automation_team_activity/models/ir_actions_server.py:0
#: model:ir.model.fields.selection,name:base_automation_team_activity.selection__ir_actions_server__activity_user_type__team
#, python-format
msgid "Specific Team"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_base_automation__team_id
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__team_id
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_cron__team_id
msgid "Team"
msgstr ""

#. module: base_automation_team_activity
#: model:ir.model.fields,help:base_automation_team_activity.field_base_automation__activity_user_type
#: model:ir.model.fields,help:base_automation_team_activity.field_ir_actions_server__activity_user_type
#: model:ir.model.fields,help:base_automation_team_activity.field_ir_cron__activity_user_type
msgid ""
"Use 'Specific User' to always assign the same user on the next activity.\n"
" Use 'Generic User From Record' to specify the field name of the user\n"
" to choose on the record.\n"
" Use 'Specific Team' to always assign the same team on the next activity.\n"
" "
msgstr ""
82 changes: 82 additions & 0 deletions base_automation_team_activity/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_automation_team_activity
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0-20231106\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 11:59+0000\n"
"PO-Revision-Date: 2024-10-21 13:00+0100\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: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_base_automation__activity_user_type
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__activity_user_type
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_cron__activity_user_type
msgid "Activity User Type"
msgstr "Tipo de actividad de usuario"

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__display_name
msgid "Display Name"
msgstr "Nombre a mostrar"

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__id
msgid "ID"
msgstr "ID"

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server____last_update
msgid "Last Modified on"
msgstr "Ultima modificación el"

#. module: base_automation_team_activity
#: model:ir.model,name:base_automation_team_activity.model_ir_actions_server
msgid "Server Action"
msgstr "Acción del servidor"

#. module: base_automation_team_activity
#: code:addons/base_automation_team_activity/models/ir_actions_server.py:0
#: model:ir.model.fields.selection,name:base_automation_team_activity.selection__ir_actions_server__activity_user_type__team
#, python-format
msgid "Specific Team"
msgstr "Equipo específico"

#. module: base_automation_team_activity
#: model:ir.model.fields,field_description:base_automation_team_activity.field_base_automation__team_id
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_actions_server__team_id
#: model:ir.model.fields,field_description:base_automation_team_activity.field_ir_cron__team_id
msgid "Team"
msgstr "Equipo"

#. module: base_automation_team_activity
#: model:ir.model.fields,help:base_automation_team_activity.field_base_automation__activity_user_type
#: model:ir.model.fields,help:base_automation_team_activity.field_ir_actions_server__activity_user_type
#: model:ir.model.fields,help:base_automation_team_activity.field_ir_cron__activity_user_type
msgid ""
"Use 'Specific User' to always assign the same user on the next "
"activity.\n"
" Use 'Generic User From Record' to specify the field name of the "
"user\n"
" to choose on the record.\n"
" Use 'Specific Team' to always assign the same team on the next "
"activity.\n"
" "
msgstr ""
"Utilice 'Usuario Específico' para asignar siempre el mismo usuario en "
"la siguiente actividad.\n"
" Utilice 'Usuario genérico del registro' para especificar el "
"nombre del campo del usuario\n"
" a elegir en el registro.\n"
" Utilice \"Equipo específico\" para asignar siempre el mismo "
"equipo a la siguiente actividad.\n"
" "
4 changes: 4 additions & 0 deletions base_automation_team_activity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Binhex - Adasat Torres
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import ir_actions_server
from . import mail_activity_mixin
29 changes: 29 additions & 0 deletions base_automation_team_activity/models/ir_actions_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Binhex - Adasat Torres
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class IrActionsServer(models.Model):
_inherit = "ir.actions.server"

activity_user_type = fields.Selection(
selection_add=[
("team", "Specific Team"),
],
ondelete={"team": "cascade"},
help="""Use 'Specific User' to always assign the same user on the next activity.
Use 'Generic User From Record' to specify the field name of the user
to choose on the record.
Use 'Specific Team' to always assign the same team on the next activity.
""",
)
team_id = fields.Many2one(
comodel_name="mail.activity.team", string="Team", ondelete="cascade"
)

def _run_action_next_activity(self, eval_context=None):
if self.activity_user_type == "team":
self = self.with_context(mail_activity_team_id=self.team_id.id)
super()._run_action_next_activity(eval_context)
return False
15 changes: 15 additions & 0 deletions base_automation_team_activity/models/mail_activity_mixin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import models


class MailActivityMixin(models.AbstractModel):
_inherit = "mail.activity.mixin"

def activity_schedule(
self, act_type_xmlid="", date_deadline=None, summary="", note="", **act_values
):
team_id = self.env.context.get("mail_activity_team_id")
if team_id:
act_values.update({"team_id": team_id, "user_id": False})
super().activity_schedule(
act_type_xmlid, date_deadline, summary, note, **act_values
)
4 changes: 4 additions & 0 deletions base_automation_team_activity/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Binhex <https://www.binhex.cloud>_`:

* Adasat Torres de León <[email protected]>

1 change: 1 addition & 0 deletions base_automation_team_activity/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This add-on allows the creation of team activities using Odoo's automated action.
2 changes: 2 additions & 0 deletions base_automation_team_activity/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To use this add-on, you just need to change the "Activity User Type"
field to "team" and select the group you want to use.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading