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

[16.0][MIG] event_session_registration_multi_qty: Migration to version 16.0 #332

Merged
Merged
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
88 changes: 88 additions & 0 deletions event_session_registration_multi_qty/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
============================
Event Registration Multi Qty
============================

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

.. |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_registration_multi_qty
: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_registration_multi_qty
: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 make registration to sessions with multiple attendees.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Go to a session registration
#. Enter the quantity of efective attendees for the record.

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_registration_multi_qty%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>`__:

* David Vidal
* Carlos Roca
* Stefan ungureanu

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_registration_multi_qty>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions event_session_registration_multi_qty/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions event_session_registration_multi_qty/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2017-19 Tecnativa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
{
"name": "Event Registration Multi Qty",
"version": "16.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/event",
"category": "Marketing",
"summary": "Allow registration grouped by quantities in sessions",
"depends": ["event_session", "event_registration_multi_qty"],
"installable": True,
"auto_install": True,
}
23 changes: 23 additions & 0 deletions event_session_registration_multi_qty/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * event_session_registration_multi_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-11 12:03+0000\n"
"PO-Revision-Date: 2023-07-11 14:05+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es_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.0.1\n"

#. module: event_session_registration_multi_qty
#: model:ir.model,name:event_session_registration_multi_qty.model_event_session
msgid "Event session"
msgstr "Sesión del evento"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * event_session_registration_multi_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-11 12:03+0000\n"
"PO-Revision-Date: 2023-07-11 12:03+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: event_session_registration_multi_qty
#: model:ir.model,name:event_session_registration_multi_qty.model_event_session
msgid "Event session"
msgstr ""
37 changes: 37 additions & 0 deletions event_session_registration_multi_qty/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * event_session_registration_multi_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-10-08 23:35+0000\n"
"Last-Translator: Sergio Zanchetta <[email protected]>\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.3.2\n"

#. module: event_session_registration_multi_qty
#: model:ir.model.fields,field_description:event_session_registration_multi_qty.field_event_session__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: event_session_registration_multi_qty
#: model:ir.model,name:event_session_registration_multi_qty.model_event_session
msgid "Event session"
msgstr "Sessione evento"

#. module: event_session_registration_multi_qty
#: model:ir.model.fields,field_description:event_session_registration_multi_qty.field_event_session__id
msgid "ID"
msgstr "ID"

#. module: event_session_registration_multi_qty
#: model:ir.model.fields,field_description:event_session_registration_multi_qty.field_event_session____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
1 change: 1 addition & 0 deletions event_session_registration_multi_qty/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import event_session
42 changes: 42 additions & 0 deletions event_session_registration_multi_qty/models/event_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2017-19 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
from odoo import api, models


class EventSession(models.Model):
_inherit = "event.session"

@api.depends("registration_ids.qty")
def _compute_seats(self):
for session in self:
if not session.event_id.registration_multi_qty:
return super()._compute_seats()
vals = {
"seats_unconfirmed": 0,
"seats_reserved": 0,
"seats_used": 0,
"seats_available": 0,
}
registrations = self.env["event.registration"].read_group(
[
("session_id", "=", session.id),
("state", "in", ["draft", "open", "done"]),
],
["state", "qty"],
["state"],
)
for registration in registrations:
if registration["state"] == "draft":
vals["seats_unconfirmed"] += registration["qty"]
elif registration["state"] == "open":
vals["seats_reserved"] += registration["qty"]
elif registration["state"] == "done":
vals["seats_used"] += registration["qty"]
vals["seats_expected"] = (
vals["seats_unconfirmed"] + vals["seats_reserved"] + vals["seats_used"]
)
if session.seats_max > 0:
vals["seats_available"] = session.seats_max - (
vals["seats_reserved"] + vals["seats_used"]
)
session.update(vals)
5 changes: 5 additions & 0 deletions event_session_registration_multi_qty/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* David Vidal
* Carlos Roca
* Stefan ungureanu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to make registration to sessions with multiple attendees.
4 changes: 4 additions & 0 deletions event_session_registration_multi_qty/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

#. Go to a session registration
#. Enter the quantity of efective attendees for the record.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading