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] pos_event_sale: Migration to 16.0 #1205

Draft
wants to merge 51 commits into
base: 16.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0a36c4a
[ADD] pos_event_sale : Module to sell events from the Point of Sale.
ivantodorovich Jun 3, 2021
c969ca8
[IMP] pos_event_sale: Improve usability in touchscreen devices
ivantodorovich Jun 23, 2021
9df4103
[FIX] pos_event_sale: Customer display
ivantodorovich Sep 3, 2021
c6b8ef2
[UPD] Update pos_event_sale.pot
oca-travis Nov 2, 2021
1905a39
[UPD] README.rst
OCA-git-bot Nov 2, 2021
453c62f
[ADD] icon.png
OCA-git-bot Nov 2, 2021
6736159
[IMP] pos_event_sale: pre-commit execution
ivantodorovich Nov 13, 2021
9790415
[MIG] pos_event_sale: Migration to 15.0
ivantodorovich Nov 13, 2021
8a43967
[UPD] Update pos_event_sale.pot
Jun 6, 2022
265b0e8
[UPD] README.rst
OCA-git-bot Jun 6, 2022
93df17a
[IMP] `pos_event_sale`: Create only the missing `event.registrations`
ivantodorovich Jul 1, 2022
d140564
pos_event_sale 15.0.1.0.1
OCA-git-bot Jul 4, 2022
d5ccfc8
[FIX] pos_event_sale: event_barcode compatibility (enterprise)
ivantodorovich Oct 3, 2022
eebe4cf
pos_event_sale 15.0.1.0.2
OCA-git-bot Oct 3, 2022
5261de7
[UPD] Update pos_event_sale.pot
Mar 6, 2023
73805c7
Update translation files
weblate Mar 6, 2023
4832289
Added translation using Weblate (Italian)
mymage Mar 9, 2023
8159c80
Translated using Weblate (Italian)
mymage Mar 9, 2023
9fdf59e
[IMP] pos_event_sale: add EventEvent.getTicketSeatsAvailable
ivantodorovich Mar 14, 2023
d332419
[IMP] pos_event_sale: homogenize event info icons
ivantodorovich Mar 14, 2023
eb1a1fa
Translated using Weblate (Italian)
mymage Mar 16, 2023
fd168f9
pos_event_sale 15.0.1.0.3
OCA-git-bot Mar 27, 2023
6510195
[IMP] pos_event_sale: Add hook to store currency_id for each existing…
Camille0907 Mar 29, 2023
037ab81
[FIX] pos_event_sale: ignore adding tickets with missing data
ivantodorovich Mar 29, 2023
0f25ef0
[IMP] pos_event_sale: Add search and filters to the EventSelector
ivantodorovich Apr 3, 2023
6979f4f
[FIX] pos_event_sale: wrong instanceof check
ivantodorovich Apr 3, 2023
19744aa
[FIX] pos_event_sale: properly handle `raiseIfNotFound` in case of Ar…
ivantodorovich Apr 3, 2023
75078d9
pos_event_sale 15.0.1.0.4
OCA-git-bot Apr 4, 2023
1d2cf1a
[UPD] Update pos_event_sale.pot
Apr 4, 2023
1b858d7
pos_event_sale 15.0.2.0.0
OCA-git-bot Apr 4, 2023
023a855
Update translation files
weblate Apr 4, 2023
6de8792
[IMP] pos_event_sale: copy event_ticket_id when cloning an Orderline
ivantodorovich Apr 4, 2023
b292e53
[FIX] pos_event_sale: confirm only draft registrations
ivantodorovich Apr 4, 2023
c2879f1
[FIX] pos_event_sale: avoid cancelling done registrations
ivantodorovich Apr 4, 2023
e64347b
[FIX] pos_event_sale: disable auto_confirmation
ivantodorovich Apr 4, 2023
7ecb170
[FIX] pos_event_sale: cancel refunded registrations when paid
ivantodorovich Apr 4, 2023
383027d
[IMP] pos_event_sale: allow to negate lines
ivantodorovich Apr 4, 2023
6e1edc0
[IMP] pos_event_sale: refactor and add unit tests
ivantodorovich Apr 5, 2023
d986482
pos_event_sale 15.0.3.0.0
OCA-git-bot Apr 6, 2023
e0aba8b
Remove duplication of event.type.ticket code in event.event.ticket
Camille0907 Apr 7, 2023
d98b293
[UPD] Update pos_event_sale.pot
Apr 7, 2023
10b4768
pos_event_sale 15.0.3.0.1
OCA-git-bot Apr 7, 2023
710bbdc
Update translation files
weblate Apr 7, 2023
69674e1
Translated using Weblate (Italian)
mymage Apr 10, 2023
ecc9378
[FIX] pos_event_sale: wrong value for payment_status computation
ivantodorovich Apr 11, 2023
83cea32
[IMP] pos_event_sale: implement event registration reprinting
ivantodorovich Apr 11, 2023
8ed5f8d
pos_event_sale 15.0.3.1.0
OCA-git-bot Apr 12, 2023
f68e405
[IMP] pos_event_sale: pre-commit stuff
BT-cserra Jun 8, 2023
af04811
[IMP] pos_event_sale: pre-commit execution
maq-adhoc Jun 11, 2024
efd3e44
[MIG] pos_event_sale: Migration to 16.0
maq-adhoc Jun 11, 2024
42fa395
[16.0][MIG] pos_event_sale: Migration to 16.0
BT-dmoreno Jul 4, 2023
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
122 changes: 122 additions & 0 deletions pos_event_sale/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
====================
Point of Sale Events
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/15.0/pos_event_sale
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-15-0/pos-15-0-pos_event_sale
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/184/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

Sell events tickets from the Point of Sale

**Table of contents**

.. contents::
:local:

Configuration
=============

Go to *Point of Sale > Configuration > Point of Sale* and enable *Sell Events*
on the desired PoS.

Optionally, you can choose to filter on a list of Event Types.

Enable *Available in PoS* on all event products related to event tickets you
want to sell in PoS. If the ticket product is not available on the pos,
the ticket won't be available neither.

Usage
=====


- Click on the Add Event button, or on any Event product.

.. image:: https://raw.githubusercontent.com/OCA/pos/15.0/pos_event_sale/static/description/add_event_button.png

- Use the calendar widget to filter the events, and click on one.

.. image:: https://raw.githubusercontent.com/OCA/pos/15.0/pos_event_sale/static/description/event_calendar.png

- Add as many Tickets as you want

.. image:: https://raw.githubusercontent.com/OCA/pos/15.0/pos_event_sale/static/description/ticket_selector.png

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


* Handle event registration details. It could be another popup right
before going to payment (similar to core `event_sale` workflow).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/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/pos/issues/new?body=module:%20pos_event_sale%0Aversion:%2015.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
~~~~~~~

* Camptocamp

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

* `Camptocamp <https://www.camptocamp.com>`_

* Iván Todorovich <ivan.todorovich@gmail.com>

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

* Grégory Schreiner <gregory@mokatourisme.fr>

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.

.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px
:target: https://github.com/ivantodorovich
:alt: ivantodorovich

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ivantodorovich|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/15.0/pos_event_sale>`_ 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 pos_event_sale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .hooks import post_init_hook, pre_init_hook
from . import models
from . import reports
40 changes: 40 additions & 0 deletions pos_event_sale/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2021 Camptocamp (https://www.camptocamp.com).
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Point of Sale Events",
"summary": "Sell events from Point of Sale",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"category": "Marketing",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"maintainers": ["ivantodorovich"],
"depends": ["event_sale", "point_of_sale"],
"data": [
"security/security.xml",
"reports/report_pos_order.xml",
"views/event_registration.xml",
"views/event_event.xml",
"views/pos_order.xml",
"views/res_config_settings.xml",
],
"assets": {
"point_of_sale.assets": [
"web/static/lib/fullcalendar/core/main.css",
"web/static/lib/fullcalendar/daygrid/main.css",
"web/static/lib/fullcalendar/core/main.js",
"web/static/lib/fullcalendar/daygrid/main.js",
"web/static/lib/fullcalendar/interaction/main.js",
"pos_event_sale/static/src/js/**/*.js",
"pos_event_sale/static/src/scss/**/*.scss",
"pos_event_sale/static/src/xml/**/*.xml",
],
"web.assets_tests": [
"pos_event_sale/static/tests/tours/**/*",
],
},
"pre_init_hook": "pre_init_hook",
"post_init_hook": "post_init_hook",
}
45 changes: 45 additions & 0 deletions pos_event_sale/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr).
# @author Iván Todorovich <ivan.todorovich@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import logging

from odoo import SUPERUSER_ID, api
from odoo.tools.sql import column_exists, create_column

_logger = logging.getLogger(__name__)


def pre_init_hook(cr):
"""Store currency_id in database for each existing pos_order_line"""
if not column_exists(cr, "pos_order_line", "currency_id"):
_logger.info("Pre-computing pos.order.line.currency_id..")
create_column(cr, "pos_order_line", "currency_id", "int4")
cr.execute(
"""
WITH pos_order_line_currency AS (
SELECT
pol.id AS id,
COALESCE(aj.currency_id, rc.currency_id) AS currency_id
FROM pos_order_line AS pol
JOIN pos_order AS po ON pol.order_id = po.id
JOIN pos_session AS ps ON po.session_id = ps.id
JOIN pos_config AS pc ON ps.config_id = pc.id
JOIN res_company AS rc ON pc.company_id = rc.id
LEFT JOIN account_journal AS aj ON pc.journal_id = aj.id
)
UPDATE pos_order_line
SET currency_id = pos_order_line_currency.currency_id
FROM pos_order_line_currency
WHERE pos_order_line.id = pos_order_line_currency.id
"""
)


def post_init_hook(cr, __):
"""Set the Event Registration product available for POS"""
env = api.Environment(cr, SUPERUSER_ID, {})
product = env.ref("event_sale.product_product_event", raise_if_not_found=False)
if product:
_logger.info("Setting default Event Product as available in Point of Sale..")
product.available_in_pos = True
Loading
Loading