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

[WIP][MIG] Migration and improvements of event_session module #408

Draft
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Draft
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
111 changes: 111 additions & 0 deletions event_session/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
==============
Event Sessions
==============

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

.. |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_session
: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_session
: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|

This module allows to create sessions associated with events.

**Table of contents**

.. contents::
:local:

Usage
=====

You can either:

* Go to Events > Sessions and create some sessions associated with an event.
* Go to an event and use the sessions wizard to create all your event sessions
according to a given schedule.

Known issues / Roadmap
======================

* In the sessions form view, for now is possible to modify multiple sessions
at the same time. This can be a bit weird for the user without having the
"SAVE" button, as it's difficult to know when the record is going to be saved
exactly. This feature is inspired by a core feature from recurring Calendar Events.
And it seems that Odoo hasn't handle this dissaperance of the "SAVE" button .

With this in mind, where propossed thre solutions:
A. Keep it as-is
B. Deprecate/ remove this feature
C. Find a better way, in terms of UX

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_session%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
~~~~~~~

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`__:

* Sergio Teruel
* David Vidal
* Carlos Roca
* Stefan Ungureanu

* Nikos Tsirintanis <[email protected]>
* David Alonso <[email protected]>

* `Moka Tourisme <https://www.mokatourisme.fr>`_

* Iván Todorovich <[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/event <https://github.com/OCA/event/tree/16.0/event_session>`_ 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 event_session/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import controllers
from . import models
from . import wizards
26 changes: 26 additions & 0 deletions event_session/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2017-19 David Vidal<[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Event Sessions",
"summary": "Sessions in events",
"version": "16.0.1.4.1",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/event",
"category": "Marketing",
"depends": ["event"],
"data": [
"data/event_session_timeslot.xml",
"data/mail_template.xml",
"security/ir.model.access.csv",
"security/security.xml",
"views/event_event.xml",
"views/event_registration.xml",
"views/event_session.xml",
"views/event_type.xml",
"reports/event_report_templates.xml",
"wizards/wizard_event_session.xml",
],
"demo": ["demo/event_session.xml"],
}
1 change: 1 addition & 0 deletions event_session/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
30 changes: 30 additions & 0 deletions event_session/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2021 Moka Tourisme (https://www.mokatourisme.fr).
# @author Iván Todorovich <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from werkzeug.exceptions import NotFound

from odoo.http import Controller, content_disposition, request, route


class EventSessionController(Controller):
@route(
"""/event/session/<model("event.session"):event_session>/ics""",
type="http",
auth="public",
)
def event_session_ics_file(self, event_session, **kwargs):
"""Similar to core :meth:`~event_ics_file` for event.event"""
files = event_session._get_ics_file()
if event_session.id not in files: # pragma: no cover
return NotFound()
content = files[event_session.id]
disposition = content_disposition(f"{event_session.name}.ics")
return request.make_response(
content,
[
("Content-Type", "application/octet-stream"),
("Content-Length", len(content)),
("Content-Disposition", disposition),
],
)
60 changes: 60 additions & 0 deletions event_session/data/event_session_timeslot.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2021 Moka Tourisme (https://www.mokatourisme.fr)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">

<record id="timeslot_10_00" model="event.session.timeslot">
<field name="time">10</field>
</record>

<record id="timeslot_11_00" model="event.session.timeslot">
<field name="time">11</field>
</record>

<record id="timeslot_12_00" model="event.session.timeslot">
<field name="time">12</field>
</record>

<record id="timeslot_13_00" model="event.session.timeslot">
<field name="time">13</field>
</record>

<record id="timeslot_14_00" model="event.session.timeslot">
<field name="time">14</field>
</record>

<record id="timeslot_15_00" model="event.session.timeslot">
<field name="time">15</field>
</record>

<record id="timeslot_16_00" model="event.session.timeslot">
<field name="time">16</field>
</record>

<record id="timeslot_17_00" model="event.session.timeslot">
<field name="time">17</field>
</record>

<record id="timeslot_18_00" model="event.session.timeslot">
<field name="time">18</field>
</record>

<record id="timeslot_19_00" model="event.session.timeslot">
<field name="time">19</field>
</record>

<record id="timeslot_20_00" model="event.session.timeslot">
<field name="time">20</field>
</record>

<record id="timeslot_21_00" model="event.session.timeslot">
<field name="time">21</field>
</record>

<record id="timeslot_22_00" model="event.session.timeslot">
<field name="time">22</field>
</record>

</odoo>
Loading
Loading