Skip to content

Commit

Permalink
[MIG] event_session_registration_multi_qty: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-tecnativa committed Jul 20, 2023
1 parent eb6b25d commit 2115193
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 67 deletions.
24 changes: 14 additions & 10 deletions event_session_registration_multi_qty/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
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
Expand All @@ -14,16 +17,16 @@ Event Registration Multi Qty
: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/14.0/event_session_registration_multi_qty
: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-14-0/event-14-0-event_session_registration_multi_qty
: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/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/199/14.0
:alt: Try me on Runbot
.. |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|
|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to make registration to sessions with multiple attendees.

Expand All @@ -45,8 +48,8 @@ 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_session_registration_multi_qty%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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.

Expand All @@ -65,6 +68,7 @@ Contributors

* David Vidal
* Carlos Roca
* Stefan ungureanu

Maintainers
~~~~~~~~~~~
Expand All @@ -79,6 +83,6 @@ 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/14.0/event_session_registration_multi_qty>`_ project on GitHub.
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.
2 changes: 1 addition & 1 deletion event_session_registration_multi_qty/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
{
"name": "Event Registration Multi Qty",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/event",
Expand Down
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
Expand Up @@ -4,31 +4,18 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"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.fields,field_description:event_session_registration_multi_qty.field_event_session__display_name
msgid "Display Name"
msgstr ""

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

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

#. 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 ""
8 changes: 0 additions & 8 deletions event_session_registration_multi_qty/models/event_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def _compute_seats(self):
"seats_reserved": 0,
"seats_used": 0,
"seats_available": 0,
"seats_available_expected": 0,
"seats_available_pc": 0,
}
registrations = self.env["event.registration"].read_group(
[
Expand All @@ -41,10 +39,4 @@ def _compute_seats(self):
vals["seats_available"] = session.seats_max - (
vals["seats_reserved"] + vals["seats_used"]
)
vals["seats_available_expected"] = (
session.seats_max - vals["seats_expected"]
)
vals["seats_available_pc"] = (
vals["seats_expected"] * 100 / float(session.seats_max)
)
session.update(vals)
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

* David Vidal
* Carlos Roca
* Stefan ungureanu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Event Registration Multi Qty</title>
<style type="text/css">

Expand Down Expand Up @@ -366,8 +366,10 @@ <h1 class="title">Event Registration Multi Qty</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d2c54557d1b16b7bf9075a89968ae2fb58981507d56e81d6c207484fca389386
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/event/tree/14.0/event_session_registration_multi_qty"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/event-14-0/event-14-0-event_session_registration_multi_qty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/199/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/event/tree/16.0/event_session_registration_multi_qty"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/event-16-0/event-16-0-event_session_registration_multi_qty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/builds?repo=OCA/event&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to make registration to sessions with multiple attendees.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -394,8 +396,8 @@ <h1><a class="toc-backref" href="#id1">Usage</a></h1>
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/event/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_session_registration_multi_qty%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="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**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -414,6 +416,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>David Vidal</li>
<li>Carlos Roca</li>
<li>Stefan ungureanu</li>
</ul>
</blockquote>
</li>
Expand All @@ -426,7 +429,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/14.0/event_session_registration_multi_qty">OCA/event</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/16.0/event_session_registration_multi_qty">OCA/event</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright 2017-19 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
from freezegun import freeze_time

from odoo.tests import common


class EventSessionRegistrationMultiQty(common.SavepointCase):
@freeze_time("2023-06-01 09:00:00", tick=True)
class EventSessionRegistrationMultiQty(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.mail_template_reminder = cls.env.ref("event_session.event_session_reminder")
cls.event = cls.env["event.event"].create(
{
"name": "Test event",
Expand Down Expand Up @@ -61,32 +65,25 @@ def setUpClass(cls):
cls.wizard = cls.env["wizard.event.session"].create(
{
"event_id": cls.event.id,
"mondays": True,
"tuesdays": True,
"wednesdays": True,
"thursdays": True,
"fridays": True,
"sundays": True,
"saturdays": True,
"delete_existing_sessions": False,
"session_hour_ids": [(0, 0, {"start_time": 20.0, "end_time": 21.0})],
"mon": True,
"tue": True,
"wed": True,
"thu": True,
"fri": True,
"sat": True,
"sun": True,
"duration": 2,
"start": "2023-06-07 09:00:00",
"until": "2023-06-15 09:00:00",
}
)
cls.template = cls.env["event.mail.template"].create(
cls.event_mail = cls.env["event.mail"].create(
{
"name": "Template test 01",
"scheduler_template_ids": [
(
0,
0,
{
"interval_nbr": 15,
"interval_unit": "days",
"interval_type": "before_event",
"template_id": cls.env.ref("event.event_reminder").id,
},
)
],
"event_id": cls.event.id,
"interval_nbr": 15,
"interval_unit": "days",
"interval_type": "before_event",
"template_ref": f"mail.template,{cls.mail_template_reminder.id}",
}
)

Expand All @@ -100,14 +97,11 @@ def test_compute_seats(self):
self.assertEqual(self.session.seats_used, 1)
self.assertEqual(self.session.seats_expected, 26)
self.assertEqual(self.session.seats_available, 229)
self.assertEqual(self.session.seats_available_expected, 224)
self.attendee_cancel.state = "draft"
self.assertEqual(self.session.seats_unconfirmed, 15)
self.assertEqual(self.session.seats_expected, 36)
self.assertEqual(self.session.seats_available, 229)
self.assertEqual(self.session.seats_available_expected, 214)
self.attendee_cancel.state = "open"
self.assertEqual(self.session.seats_unconfirmed, 5)
self.assertEqual(self.session.seats_expected, 36)
self.assertEqual(self.session.seats_available, 219)
self.assertEqual(self.session.seats_available_expected, 214)

0 comments on commit 2115193

Please sign in to comment.