Skip to content

Commit

Permalink
[MIG] event_sale_reservation: Migration to 13.0
Browse files Browse the repository at this point in the history
TT31321
  • Loading branch information
victoralmau committed Jan 25, 2022
1 parent a12d49a commit 535655e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
after_success:
- stage: test
env:
- TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1"
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="event_sale_reservation" MAKEPOT="1"
- stage: test
env:
- TESTS="1" ODOO_REPO="OCA/OCB"
- TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE="event_sale_reservation"

env:
global:
Expand Down
10 changes: 5 additions & 5 deletions event_sale_reservation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Sell event reservations
: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/12.0/event_sale_reservation
:target: https://github.com/OCA/event/tree/13.0/event_sale_reservation
:alt: OCA/event
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/event-12-0/event-12-0-event_sale_reservation
:target: https://translation.odoo-community.org/projects/event-13-0/event-13-0-event_sale_reservation
: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/12.0
:target: https://runbot.odoo-community.org/runbot/199/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -121,7 +121,7 @@ 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_sale_reservation%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_sale_reservation%0Aversion:%2013.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 Down Expand Up @@ -159,6 +159,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Yajo|

This module is part of the `OCA/event <https://github.com/OCA/event/tree/12.0/event_sale_reservation>`_ project on GitHub.
This module is part of the `OCA/event <https://github.com/OCA/event/tree/13.0/event_sale_reservation>`_ 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_sale_reservation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Sell event reservations",
"summary": "Allow selling event registrations before the event exists",
"version": "12.0.1.0.0",
"version": "13.0.1.0.0",
"development_status": "Beta",
"category": "Marketing",
"website": "https://github.com/OCA/event",
Expand Down
2 changes: 1 addition & 1 deletion event_sale_reservation/models/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def _compute_reservations_total(self):
def action_open_sale_orders(self):
"""Display SO that include reservations."""
sol = self.env["sale.order.line"].search(self._seats_reservation_domain(),)
result = self.env["ir.actions.act_window"].for_xml_id("sale", "action_orders",)
result = self.env["ir.actions.act_window"].for_xml_id("sale", "action_orders")
result["domain"] = [("order_line", "in", sol.ids)]
return result
1 change: 0 additions & 1 deletion event_sale_reservation/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ def action_open_event_registrations(self):
"res_model": "event.registration",
"type": "ir.actions.act_window",
"view_mode": "tree,form,calendar,graph",
"view_type": "form",
}
4 changes: 3 additions & 1 deletion event_sale_reservation/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* Jairo Llopis <jairo.llopis@tecnativa.com> (https://www.tecnativa.com/)
* `Tecnativa <https://www.tecnativa.com>`_:

* Jairo Llopis
22 changes: 13 additions & 9 deletions event_sale_reservation/reports/sale_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo.tools import frozendict


class SaleReport(models.Model):
Expand All @@ -12,12 +11,17 @@ class SaleReport(models.Model):
comodel_name="event.type", readonly=True, string="Event reservation type",
)

def _query(self, with_clause="", fields=frozendict(), groupby="", from_clause=""):
fields = dict(
fields,
event_reservation_type_id="""
, t.event_reservation_type_id as event_reservation_type_id
""",
)
def _query(self, with_clause="", fields=None, groupby="", from_clause=""):
if fields is None:
fields = {}
select_str = """ ,
t.event_reservation_type_id as event_reservation_type_id
"""
fields.update({"event_reservation_type_id": select_str})
groupby += ", t.event_reservation_type_id"
return super()._query(with_clause, fields, groupby, from_clause)
return super()._query(
with_clause=with_clause,
fields=fields,
groupby=groupby,
from_clause=from_clause,
)
8 changes: 4 additions & 4 deletions event_sale_reservation/static/description/index.html
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>Sell event reservations</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Sell event reservations</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/12.0/event_sale_reservation"><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-12-0/event-12-0-event_sale_reservation"><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/12.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/13.0/event_sale_reservation"><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-13-0/event-13-0-event_sale_reservation"><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/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of event_sale to support selling
reservations of events that still don’t exist and to allow you to schedule the
creation of events based on how many reservations already exist.</p>
Expand Down Expand Up @@ -466,7 +466,7 @@ <h1><a class="toc-backref" href="#id4">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_sale_reservation%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_sale_reservation%0Aversion:%2013.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 @@ -492,7 +492,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/Yajo"><img alt="Yajo" src="https://github.com/Yajo.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/12.0/event_sale_reservation">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/13.0/event_sale_reservation">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
2 changes: 1 addition & 1 deletion event_sale_reservation/views/sale_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<record id="view_sale_order_form_inherit_event" model="ir.ui.view">
<field name="name">Event reservation management</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="event_sale.view_sale_order_form_inherit_event" />
<field name="inherit_id" ref="event_sale.sale_order_view_form" />
<field name="arch" type="xml">
<button id="action_confirm" position="after">
<field name="event_reservations_pending" invisible="1" />
Expand Down
5 changes: 3 additions & 2 deletions event_sale_reservation/wizards/registration_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ def default_get(self, fields):
for sol in order.order_line:
if not sol.product_id.event_reservation_ok:
continue
sol_type = sol.event_reservation_type_id
result["event_registration_ids"] += [
(
0,
0,
{
"sale_order_line_id": sol.id,
"event_reservation_type_id": sol.event_reservation_type_id.id,
"event_reservation_type_id": sol_type.id,
},
)
]
Expand Down Expand Up @@ -63,5 +64,5 @@ def action_make_registration(self):
result = super().action_make_registration()
return {
"type": "ir.actions.act_multi",
"actions": [result, {"type": "ir.actions.act_view_reload"},],
"actions": [result, {"type": "ir.actions.act_view_reload"}],
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<field name="name">Register in event</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">registration.editor</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="registration_editor_reservations_view_form" />
<field name="target">new</field>
Expand Down

0 comments on commit 535655e

Please sign in to comment.