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

[ADD] event_track_speaker_book #322

Open
wants to merge 12 commits into
base: 16.0
Choose a base branch
from
70 changes: 70 additions & 0 deletions event_track_speaker_book/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
========================
Event Track Speaker Book
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-coopiteasy%2Faddons-lightgray.png?logo=github
:target: https://github.com/coopiteasy/addons/tree/16.0/event_track_speaker_book
:alt: coopiteasy/addons

|badge1| |badge2| |badge3|

Manage Books Presented by Speakers

**Table of contents**

.. contents::
:local:

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

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

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

Current maintainer:

|maintainer-victor-champonnois|

This module is part of the `coopiteasy/addons <https://github.com/coopiteasy/addons/tree/16.0/event_track_speaker_book>`_ project on GitHub.

You are welcome to contribute.
4 changes: 4 additions & 0 deletions event_track_speaker_book/__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
26 changes: 26 additions & 0 deletions event_track_speaker_book/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "Event Track Speaker Book",
"summary": """Manage Books Presented by Speakers""",
"version": "16.0.1.0.0",
"category": "Event",
"website": "https://github.com/coopiteasy/addons",
"author": "Coop IT Easy SC",
"maintainers": ["victor-champonnois"],
"license": "AGPL-3",
"application": False,
"depends": ["event_track_multi_speaker"],
"excludes": [],
"data": [
"security/ir.model.access.csv",
"views/event_track.xml",
"views/event_track_speaker.xml",
"views/event_track_speaker_book.xml",
"views/menuitems.xml",
],
"demo": [],
"qweb": [],
}
4 changes: 4 additions & 0 deletions event_track_speaker_book/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import event_track
from . import event_track_speaker
from . import event_track_speaker_book
from . import event_track_speaker_book_provider
19 changes: 19 additions & 0 deletions event_track_speaker_book/models/event_track.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Coop IT Easy <https://coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


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

book_ids = fields.Many2many(
comodel_name="event.track.speaker.book",
string="Books",
)

@api.onchange("speaker_ids")
def get_book_domain(self):
for rec in self:
speakers_book_ids = rec.speaker_ids._origin.mapped("book_ids").mapped("id")
return {"domain": {"book_ids": [("id", "in", speakers_book_ids)]}}
10 changes: 10 additions & 0 deletions event_track_speaker_book/models/event_track_speaker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Coop IT Easy <https://coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

book_ids = fields.Many2many("event.track.speaker.book", string="Books")
29 changes: 29 additions & 0 deletions event_track_speaker_book/models/event_track_speaker_book.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Coop IT Easy <https://coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

name = fields.Char(string="Title")
author_ids = fields.Many2many(comodel_name="res.partner", string="Authors")
editor_id = fields.Many2one(comodel_name="res.partner", string="Editor")
user_id = fields.Many2one("res.users", string="Referent")
speaker_ids = fields.Many2many("event.track.speaker", string="Speakers")
provider_id = fields.Many2one(
"event.track.speaker.book.provider",
string="Provider",
)
status = fields.Selection(
selection=[
("asked", "Asked"),
("received", "Received"),
("reading", "Reading"),
("done", "Done"),
],
default="asked",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from odoo import fields, models


class EventTrackSpeakerBookProvider(models.Model):
_name = "event.track.speaker.book.provider"
_description = "Track Speaker Book Provider"

name = fields.Char()
3 changes: 3 additions & 0 deletions event_track_speaker_book/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_speaker_book/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manage Books Presented by Speakers
5 changes: 5 additions & 0 deletions event_track_speaker_book/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_event_track_speaker_book_registration,event.track.speaker.book.user,event_track_speaker_book.model_event_track_speaker_book,event.group_event_registration_desk,1,0,0,0
access_event_track_speaker_book_user,event.track.speaker.book.user,event_track_speaker_book.model_event_track_speaker_book,event.group_event_user,1,1,1,1
access_event_track_speaker_book_provider_registration,event.track.speaker.book.provider.user,event_track_speaker_book.model_event_track_speaker_book_provider,event.group_event_registration_desk,1,0,0,0
access_event_track_speaker_book_provider_user,event.track.speaker.book.provider.user,event_track_speaker_book.model_event_track_speaker_book_provider,event.group_event_user,1,1,1,1
Loading
Loading