diff --git a/event_contact/README.rst b/event_contact/README.rst new file mode 100644 index 000000000..9e6770578 --- /dev/null +++ b/event_contact/README.rst @@ -0,0 +1,118 @@ +============== +Event Contacts +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e6c5e6ae07ae82f6291171aeb778c717ee5d80aafe84bc020538921221d64afd + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fevent-lightgray.png?logo=github + :target: https://github.com/OCA/event/tree/17.0/event_contact + :alt: OCA/event +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_contact + :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/event&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the possibility to define contacts for the event. +Contacts are needed due to inform the people who should be contacted for +the event. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To set contacts to event, you need to: + +1. Go to *Events > Events*. +2. Edit or create one. +3. You will see a new field under field *Organizer* named *Contacts*. + +To set contacts for an event type, you need to: + +1. Go to *Events > Configuration > Event Templates*. +2. Edit or create one. +3. You will see a new field under field *Tags* named *Contacts*. +4. After doing this, if you create an event and set it this type, the + event will get appended these contacts automatically. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* OpenSynergy Indonesia +* Tecnativa + +Contributors +------------ + +- Michael Viriyananda +- David Alonso +- `Tecnativa `__: + + - Jairo Llopis + - Alexandre Díaz + - Ernesto Tejeda + +- Eduardo López +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn +.. |maintainer-edlopen| image:: https://github.com/edlopen.png?size=40px + :target: https://github.com/edlopen + :alt: edlopen + +Current `maintainers `__: + +|maintainer-rafaelbn| |maintainer-edlopen| + +This module is part of the `OCA/event `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/event_contact/__init__.py b/event_contact/__init__.py new file mode 100644 index 000000000..83e553ac4 --- /dev/null +++ b/event_contact/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/event_contact/__manifest__.py b/event_contact/__manifest__.py new file mode 100644 index 000000000..14d65b697 --- /dev/null +++ b/event_contact/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2016 OpenSynergy Indonesia +# Copyright 2016-2017 Jairo Llopis +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Event Contacts", + "version": "17.0.1.0.0", + "summary": "Add contacts to event and event type", + "author": "OpenSynergy Indonesia, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/event", + "category": "Marketing", + "depends": ["event"], + "maintainers": ["rafaelbn", "edlopen"], + "data": ["views/event_event_view.xml", "views/event_type_view.xml"], + "installable": True, + "license": "AGPL-3", +} diff --git a/event_contact/i18n/es.po b/event_contact/i18n/es.po new file mode 100644 index 000000000..d38f828ba --- /dev/null +++ b/event_contact/i18n/es.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_contact +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-05 22:25+0000\n" +"PO-Revision-Date: 2023-12-29 10:33+0000\n" +"Last-Translator: Ivorra78 \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: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: event_contact +#: model:ir.model.fields,field_description:event_contact.field_event_event__contact_ids +#: model:ir.model.fields,field_description:event_contact.field_event_type__contact_ids +msgid "Contacts" +msgstr "Contactos" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_event +msgid "Event" +msgstr "Evento" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_type +msgid "Event Template" +msgstr "Plantilla del Evento" + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_type__contact_ids +msgid "" +"Partners available to attend attendees requests by default for events of " +"this type." +msgstr "" +"Contactos disponibles por defecto para atender las peticiones de los " +"asistentes para los eventos de este tipo." + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_event__contact_ids +msgid "Partners available to attend attendees requests for this event." +msgstr "" +"Contactos disponibles para atender las peticiones de los asistentes para " +"este evento." + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Event Type" +#~ msgstr "Tipo de evento" diff --git a/event_contact/i18n/event_contact.pot b/event_contact/i18n/event_contact.pot new file mode 100644 index 000000000..fb75e407d --- /dev/null +++ b/event_contact/i18n/event_contact.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_contact +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: event_contact +#: model:ir.model.fields,field_description:event_contact.field_event_event__contact_ids +#: model:ir.model.fields,field_description:event_contact.field_event_type__contact_ids +msgid "Contacts" +msgstr "" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_event +msgid "Event" +msgstr "" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_type +msgid "Event Template" +msgstr "" + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_type__contact_ids +msgid "" +"Partners available to attend attendees requests by default for events of " +"this type." +msgstr "" + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_event__contact_ids +msgid "Partners available to attend attendees requests for this event." +msgstr "" diff --git a/event_contact/i18n/it.po b/event_contact/i18n/it.po new file mode 100644 index 000000000..1256aac3d --- /dev/null +++ b/event_contact/i18n/it.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_contact +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-20 08:09+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: event_contact +#: model:ir.model.fields,field_description:event_contact.field_event_event__contact_ids +#: model:ir.model.fields,field_description:event_contact.field_event_type__contact_ids +msgid "Contacts" +msgstr "Contatti" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_event +msgid "Event" +msgstr "Evento" + +#. module: event_contact +#: model:ir.model,name:event_contact.model_event_type +msgid "Event Template" +msgstr "Modello evento" + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_type__contact_ids +msgid "" +"Partners available to attend attendees requests by default for events of " +"this type." +msgstr "" +"Partner disponibili in modo predefinito ad iscrivere partecipanti per eventi " +"di questo tipo." + +#. module: event_contact +#: model:ir.model.fields,help:event_contact.field_event_event__contact_ids +msgid "Partners available to attend attendees requests for this event." +msgstr "Partner disponibili ad iscrivere partecipanti per questo evento." + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/event_contact/models/__init__.py b/event_contact/models/__init__.py new file mode 100644 index 000000000..70c4944f6 --- /dev/null +++ b/event_contact/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import event_event +from . import event_type diff --git a/event_contact/models/event_event.py b/event_contact/models/event_event.py new file mode 100644 index 000000000..70335672a --- /dev/null +++ b/event_contact/models/event_event.py @@ -0,0 +1,23 @@ +# Copyright 2016 OpenSynergy Indonesia +# Copyright 2017 Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class EventEvent(models.Model): + _inherit = "event.event" + + contact_ids = fields.Many2many( + string="Contacts", + comodel_name="res.partner", + help="Partners available to attend attendees requests for this event.", + compute="_compute_contact_ids", + store=True, + readonly=False, + ) + + @api.depends("event_type_id") + def _compute_contact_ids(self): + for one in self: + one.contact_ids |= one.event_type_id.contact_ids diff --git a/event_contact/models/event_type.py b/event_contact/models/event_type.py new file mode 100644 index 000000000..d1fc9a9f8 --- /dev/null +++ b/event_contact/models/event_type.py @@ -0,0 +1,16 @@ +# Copyright 2016 OpenSynergy Indonesia +# Copyright 2017 Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class EventType(models.Model): + _inherit = "event.type" + + contact_ids = fields.Many2many( + string="Contacts", + comodel_name="res.partner", + help="Partners available to attend attendees requests by default for " + "events of this type.", + ) diff --git a/event_contact/pyproject.toml b/event_contact/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/event_contact/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/event_contact/readme/CONTRIBUTORS.md b/event_contact/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..13ff3a393 --- /dev/null +++ b/event_contact/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- Michael Viriyananda \<\> +- David Alonso \<\> +- [Tecnativa](https://www.tecnativa.com): + - Jairo Llopis + - Alexandre Díaz + - Ernesto Tejeda +- Eduardo López \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/event_contact/readme/DESCRIPTION.md b/event_contact/readme/DESCRIPTION.md new file mode 100644 index 000000000..fa21e6f41 --- /dev/null +++ b/event_contact/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adds the possibility to define contacts for the event. +Contacts are needed due to inform the people who should be contacted for +the event. diff --git a/event_contact/readme/USAGE.md b/event_contact/readme/USAGE.md new file mode 100644 index 000000000..ebb46f26d --- /dev/null +++ b/event_contact/readme/USAGE.md @@ -0,0 +1,13 @@ +To set contacts to event, you need to: + +1. Go to *Events \> Events*. +2. Edit or create one. +3. You will see a new field under field *Organizer* named *Contacts*. + +To set contacts for an event type, you need to: + +1. Go to *Events \> Configuration \> Event Templates*. +2. Edit or create one. +3. You will see a new field under field *Tags* named *Contacts*. +4. After doing this, if you create an event and set it this type, the + event will get appended these contacts automatically. diff --git a/event_contact/static/description/icon.png b/event_contact/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/event_contact/static/description/icon.png differ diff --git a/event_contact/static/description/index.html b/event_contact/static/description/index.html new file mode 100644 index 000000000..da61a7186 --- /dev/null +++ b/event_contact/static/description/index.html @@ -0,0 +1,458 @@ + + + + + +Event Contacts + + + +
+

Event Contacts

+ + +

Beta License: AGPL-3 OCA/event Translate me on Weblate Try me on Runboat

+

This module adds the possibility to define contacts for the event. +Contacts are needed due to inform the people who should be contacted for +the event.

+

Table of contents

+ +
+

Usage

+

To set contacts to event, you need to:

+
    +
  1. Go to Events > Events.
  2. +
  3. Edit or create one.
  4. +
  5. You will see a new field under field Organizer named Contacts.
  6. +
+

To set contacts for an event type, you need to:

+
    +
  1. Go to Events > Configuration > Event Templates.
  2. +
  3. Edit or create one.
  4. +
  5. You will see a new field under field Tags named Contacts.
  6. +
  7. After doing this, if you create an event and set it this type, the +event will get appended these contacts automatically.
  8. +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • OpenSynergy Indonesia
  • +
  • Tecnativa
  • +
+
+
+

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.

+

Current maintainers:

+

rafaelbn edlopen

+

This module is part of the OCA/event project on GitHub.

+

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

+
+
+
+ + diff --git a/event_contact/tests/__init__.py b/event_contact/tests/__init__.py new file mode 100644 index 000000000..f1af51fbd --- /dev/null +++ b/event_contact/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_event diff --git a/event_contact/tests/test_event.py b/event_contact/tests/test_event.py new file mode 100644 index 000000000..1b2762fad --- /dev/null +++ b/event_contact/tests/test_event.py @@ -0,0 +1,53 @@ +# Copyright 2016-2017 Jairo Llopis +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import Command +from odoo.tests.common import TransactionCase + + +class EventCase(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + # Partners + cls.partner1 = cls.env["res.partner"].create({"name": "Test Partner 1"}) + cls.partner2 = cls.env["res.partner"].create({"name": "Test Partner 2"}) + cls.partner3 = cls.env["res.partner"].create({"name": "Test Partner 3"}) + cls.partner4 = cls.env["res.partner"].create({"name": "Test Partner 4"}) + cls.partner5 = cls.env["res.partner"].create({"name": "Test Partner 5"}) + + cls.type1 = cls.env["event.type"].create( + { + "name": "Event Type Test 1", + "contact_ids": [Command.set([cls.partner1.id, cls.partner2.id])], + } + ) + cls.type2 = cls.env["event.type"].create( + { + "name": "Event Type Test 2", + "contact_ids": [Command.set([cls.partner3.id, cls.partner4.id])], + } + ) + + cls.event1 = cls.env["event.event"].create( + { + "name": "Event Test 1", + "date_begin": "2019-06-20", + "date_end": "2019-06-23", + } + ) + + def test_event_onchange_type_contacts_empty(self): + """You get default contacts from type.""" + self.event1.event_type_id = self.type2 + self.assertEqual(self.event1.contact_ids, self.type2.contact_ids) + + def test_event_onchange_type_contacts_full(self): + """Contacts not updated because it is not empty.""" + self.event1.contact_ids = [Command.set([self.partner5.id])] + self.event1.event_type_id = self.type1 + self.assertEqual( + self.event1.contact_ids, self.partner5 | self.type1.contact_ids + ) diff --git a/event_contact/views/event_event_view.xml b/event_contact/views/event_event_view.xml new file mode 100644 index 000000000..b06d819f3 --- /dev/null +++ b/event_contact/views/event_event_view.xml @@ -0,0 +1,13 @@ + + + + Event Contacts + event.event + + + + + + + + diff --git a/event_contact/views/event_type_view.xml b/event_contact/views/event_type_view.xml new file mode 100644 index 000000000..f831bfbd8 --- /dev/null +++ b/event_contact/views/event_type_view.xml @@ -0,0 +1,16 @@ + + + + + Add contacts + event.type + + + + + + + +