Skip to content

Commit

Permalink
[ADD] event_track_multi_speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois committed Aug 8, 2024
1 parent ed860ef commit 0a67f6c
Show file tree
Hide file tree
Showing 17 changed files with 746 additions and 0 deletions.
86 changes: 86 additions & 0 deletions event_track_multi_speaker/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=========================
Event Track Multi Speaker
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b68a380bf957a04f6f20f29ec5d8d1c62121548ca3853a7735dc98e82229043a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/event_track_multi_speaker
:alt: OCA/event
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/event-16-0/event-16-0-event_track_multi_speaker
: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=16.0
:alt: Try me on Runboat

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

Allow for several speaker on event tracks

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/event/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/event/issues/new?body=module:%20event_track_multi_speaker%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
~~~~~~~

* Coop IT Easy SC

Contributors
~~~~~~~~~~~~

* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Victor Champonnois

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-victor-champonnois| image:: https://github.com/victor-champonnois.png?size=40px
:target: https://github.com/victor-champonnois
:alt: victor-champonnois

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

|maintainer-victor-champonnois|

This module is part of the `OCA/event <https://github.com/OCA/event/tree/16.0/event_track_multi_speaker>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions event_track_multi_speaker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from . import models
27 changes: 27 additions & 0 deletions event_track_multi_speaker/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "Event Track Multi Speaker",
"summary": """
Allow for several speaker on event tracks""",
"version": "16.0.1.0.0",
"category": "Uncategorized",
"website": "https://github.com/OCA/event",
"author": "Coop IT Easy SC, Odoo Community Association (OCA)",
"maintainers": ["victor-champonnois"],
"license": "AGPL-3",
"application": False,
"depends": ["website_event_track"],
"excludes": [],
"data": [
"security/ir.model.access.csv",
"views/event_track.xml",
"views/event_track_speaker.xml",
"views/event_event.xml",
"views/menuitems.xml",
],
"demo": [],
"qweb": [],
}
3 changes: 3 additions & 0 deletions event_track_multi_speaker/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import event_track
from . import event_track_speaker
from . import event
19 changes: 19 additions & 0 deletions event_track_multi_speaker/models/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2017 David Vidal<[email protected]>
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class EventTrack(models.Model):
_inherit = "event.event"

speaker_ids = fields.One2many(
comodel_name="event.track", compute="_compute_speakers", string="Speakers"
)

@api.depends("track_ids.speaker_ids")
def _compute_speakers(self):
speakers = []

Check warning on line 17 in event_track_multi_speaker/models/event.py

View check run for this annotation

Codecov / codecov/patch

event_track_multi_speaker/models/event.py#L17

Added line #L17 was not covered by tests
for track in self.track_ids:
speakers += track.speaker_ids

Check warning on line 19 in event_track_multi_speaker/models/event.py

View check run for this annotation

Codecov / codecov/patch

event_track_multi_speaker/models/event.py#L19

Added line #L19 was not covered by tests
13 changes: 13 additions & 0 deletions event_track_multi_speaker/models/event_track.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2017 David Vidal<[email protected]>
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class EventTrack(models.Model):
_inherit = "event.track"

speaker_ids = fields.Many2many(
comodel_name="event.track.speaker", string="Speakers"
)
38 changes: 38 additions & 0 deletions event_track_multi_speaker/models/event_track_speaker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2017 David Vidal<[email protected]>
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class EventTrackSpeaker(models.Model):
_name = "event.track.speaker"
_description = "Track Speaker"
_inherit = ["mail.thread", "mail.activity.mixin"]

name = fields.Char(related="partner_id.name")
email = fields.Char(related="partner_id.email")
phone = fields.Char(related="partner_id.phone")
biography = fields.Html(related="partner_id.website_description")
function = fields.Char(related="partner_id.function")
image = fields.Image(related="partner_id.image_256")
partner_id = fields.Many2one("res.partner", string="Contact")
track_ids = fields.Many2many(
comodel_name="event.track",
string="Speakers",
)
status = fields.Selection(
selection=[
("draft", "Draft"),
("waiting", "Waiting"),
("validated", "Validated"),
]
)

# @api.depends("track_ids.speaker_ids")
# def compute_tracks(self):
# tracks = self.env["event.track"].search([]).filtered(
# lambda : self in
# )
# for track in self.track_ids:
# speakers += track.speaker_ids
3 changes: 3 additions & 0 deletions event_track_multi_speaker/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Victor Champonnois
1 change: 1 addition & 0 deletions event_track_multi_speaker/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow for several speaker on event tracks
2 changes: 2 additions & 0 deletions event_track_multi_speaker/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_event_track_speaker,event.track.speaker.user,event_track_multi_speaker.model_event_track_speaker,event.group_event_user,1,1,1,1
Loading

0 comments on commit 0a67f6c

Please sign in to comment.