Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[12.0] event_sale_session: Migration to 12.0
- Loading branch information
1 parent
0d2018a
commit cee87f4
Showing
21 changed files
with
604 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,86 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
=================== | ||
Event Sale Sessions | ||
=================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
Sell tickets associated to sessions | ||
=================================== | ||
.. |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/12.0/event_sale_session | ||
: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_session | ||
: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 | ||
:alt: Try me on Runbot | ||
|
||
Adds the option of choosing a session when selling an event ticket | ||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Adds the option of choosing a session when selling an event ticket. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Place a sale order and choose an event registration product. | ||
#. If the event has sessions, you'll be compelled to choose one. | ||
#. The registration will be added to such session once the sale order is | ||
confirmed. | ||
|
||
Known issues / Roadmap | ||
====================== | ||
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_session%0Aversion:%2012.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 | ||
------------ | ||
~~~~~~~~~~~~ | ||
|
||
* Sergio Teruel <sergio.teruel@tecnativa.com> | ||
* David Vidal <david.vidal@tecnativa.com> | ||
* `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
Maintainer | ||
---------- | ||
* Sergio Teruel | ||
* David Vidal | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
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. | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/event <https://github.com/OCA/event/tree/12.0/event_sale_session>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from . import models | ||
from . import reports | ||
from . import wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
* Sergio Teruel | ||
* David Vidal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Adds the option of choosing a session when selling an event ticket. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
To use this module, you need to: | ||
|
||
#. Place a sale order and choose an event registration product. | ||
#. If the event has sessions, you'll be compelled to choose one. | ||
#. The registration will be added to such session once the sale order is | ||
confirmed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import sale_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2017 Sergio Teruel <sergio.teruel@tecnativa.com> | ||
# Copyright 2019 David Vidal <david.vidal@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo import models, fields | ||
|
||
|
||
class SaleReport(models.Model): | ||
_inherit = "sale.report" | ||
|
||
event_id = fields.Many2one( | ||
comodel_name='event.event', | ||
string='Event', | ||
readonly=True, | ||
) | ||
session_id = fields.Many2one( | ||
comodel_name='event.session', | ||
string='Session', | ||
readonly=True, | ||
) | ||
event_session_count = fields.Integer( | ||
string='Number of event sessions', readonly=True, group_operator="avg") | ||
|
||
def _query(self, with_clause='', fields=None, groupby='', from_clause=''): | ||
fields = dict(fields or {}) | ||
fields.update({ | ||
'event_id': ' ,min(l.event_id) as event_id', | ||
'session_id': ' ,min(l.session_id) as session_id', | ||
'event_session_count': | ||
', min(ev.sessions_count) as event_session_count', | ||
}) | ||
from_clause += """ | ||
LEFT JOIN event_session es ON l.session_id = es.id | ||
LEFT JOIN event_event ev ON l.event_id = ev.id | ||
""" | ||
groupby += """ | ||
,l.event_id, l.session_id, l.id | ||
""" | ||
return super()._query(with_clause, fields, groupby, from_clause) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
<!-- Copyright 2017 Sergio Teruel <sergio.teruel@tecnativa.com> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record id="view_order_product_pivot" model="ir.ui.view"> | ||
<field name="model">sale.report</field> | ||
<field name="inherit_id" ref="sale.view_order_product_pivot"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='confirmation_date']" position="after"> | ||
<field name="event_id" type="row"/> | ||
<field name="session_id" type="row"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="view_order_product_search" model="ir.ui.view"> | ||
<field name="model">sale.report</field> | ||
<field name="inherit_id" ref="sale.view_order_product_search"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='product_id']" position="after"> | ||
<field name="event_id"/> | ||
<field name="session_id"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
Oops, something went wrong.