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 16.0 #1022

Open
wants to merge 49 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d249d5f
[ADD] pos_event_sale : Module to sell events from the Point of Sale.
ivantodorovich Jun 3, 2021
ea031ae
[IMP] pos_event_sale: Improve usability in touchscreen devices
ivantodorovich Jun 23, 2021
389fc3c
[FIX] pos_event_sale: Customer display
ivantodorovich Sep 3, 2021
aced61e
[UPD] Update pos_event_sale.pot
oca-travis Nov 2, 2021
a893fe4
[UPD] README.rst
OCA-git-bot Nov 2, 2021
7ce64ed
[ADD] icon.png
OCA-git-bot Nov 2, 2021
1a39879
[IMP] pos_event_sale: pre-commit execution
ivantodorovich Nov 13, 2021
c40cbe2
[MIG] pos_event_sale: Migration to 15.0
ivantodorovich Nov 13, 2021
5ecd9de
[UPD] Update pos_event_sale.pot
Jun 6, 2022
cd526a8
[UPD] README.rst
OCA-git-bot Jun 6, 2022
f4ef8f0
[IMP] `pos_event_sale`: Create only the missing `event.registrations`
ivantodorovich Jul 1, 2022
84a031c
pos_event_sale 15.0.1.0.1
OCA-git-bot Jul 4, 2022
8ec08b2
[FIX] pos_event_sale: event_barcode compatibility (enterprise)
ivantodorovich Oct 3, 2022
c46e86c
pos_event_sale 15.0.1.0.2
OCA-git-bot Oct 3, 2022
59063d3
[UPD] Update pos_event_sale.pot
Mar 6, 2023
6ba8443
Update translation files
weblate Mar 6, 2023
1888e78
Added translation using Weblate (Italian)
mymage Mar 9, 2023
21b0f6d
Translated using Weblate (Italian)
mymage Mar 9, 2023
28d0a5a
[IMP] pos_event_sale: add EventEvent.getTicketSeatsAvailable
ivantodorovich Mar 14, 2023
caa3c91
[IMP] pos_event_sale: homogenize event info icons
ivantodorovich Mar 14, 2023
2303433
Translated using Weblate (Italian)
mymage Mar 16, 2023
d88a61c
pos_event_sale 15.0.1.0.3
OCA-git-bot Mar 27, 2023
0bdbf1d
[IMP] pos_event_sale: Add hook to store currency_id for each existing…
Camille0907 Mar 29, 2023
b628ba3
[FIX] pos_event_sale: ignore adding tickets with missing data
ivantodorovich Mar 29, 2023
6390710
[IMP] pos_event_sale: Add search and filters to the EventSelector
ivantodorovich Apr 3, 2023
21fae92
[FIX] pos_event_sale: wrong instanceof check
ivantodorovich Apr 3, 2023
898d2d7
[FIX] pos_event_sale: properly handle `raiseIfNotFound` in case of Ar…
ivantodorovich Apr 3, 2023
3f16c83
pos_event_sale 15.0.1.0.4
OCA-git-bot Apr 4, 2023
bb2e831
[UPD] Update pos_event_sale.pot
Apr 4, 2023
eb71007
pos_event_sale 15.0.2.0.0
OCA-git-bot Apr 4, 2023
de6d12c
Update translation files
weblate Apr 4, 2023
bc795f5
[IMP] pos_event_sale: copy event_ticket_id when cloning an Orderline
ivantodorovich Apr 4, 2023
ecdeae9
[FIX] pos_event_sale: confirm only draft registrations
ivantodorovich Apr 4, 2023
58d7440
[FIX] pos_event_sale: avoid cancelling done registrations
ivantodorovich Apr 4, 2023
79df6b7
[FIX] pos_event_sale: disable auto_confirmation
ivantodorovich Apr 4, 2023
3a7f431
[FIX] pos_event_sale: cancel refunded registrations when paid
ivantodorovich Apr 4, 2023
410e64f
[IMP] pos_event_sale: allow to negate lines
ivantodorovich Apr 4, 2023
8957336
[IMP] pos_event_sale: refactor and add unit tests
ivantodorovich Apr 5, 2023
4fe0edf
pos_event_sale 15.0.3.0.0
OCA-git-bot Apr 6, 2023
676654f
Remove duplication of event.type.ticket code in event.event.ticket
Camille0907 Apr 7, 2023
104545a
[UPD] Update pos_event_sale.pot
Apr 7, 2023
d88cef4
pos_event_sale 15.0.3.0.1
OCA-git-bot Apr 7, 2023
bf992a0
Update translation files
weblate Apr 7, 2023
909bf23
Translated using Weblate (Italian)
mymage Apr 10, 2023
3d30f83
[FIX] pos_event_sale: wrong value for payment_status computation
ivantodorovich Apr 11, 2023
1708114
[IMP] pos_event_sale: implement event registration reprinting
ivantodorovich Apr 11, 2023
efd0b57
pos_event_sale 15.0.3.1.0
OCA-git-bot Apr 12, 2023
84d65f2
[IMP] pos_event_sale: pre-commit stuff
BT-cserra Jun 8, 2023
e8d89b1
[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