diff --git a/setup/website_event_sale_seat_reserve/odoo/addons/website_event_sale_seat_reserve b/setup/website_event_sale_seat_reserve/odoo/addons/website_event_sale_seat_reserve new file mode 120000 index 000000000..4ede6e82a --- /dev/null +++ b/setup/website_event_sale_seat_reserve/odoo/addons/website_event_sale_seat_reserve @@ -0,0 +1 @@ +../../../../website_event_sale_seat_reserve \ No newline at end of file diff --git a/setup/website_event_sale_seat_reserve/setup.py b/setup/website_event_sale_seat_reserve/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/website_event_sale_seat_reserve/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..ceed90141 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +odoo-addon-event_seat_reserve @ git+https://github.com/OCA/event.git@refs/pull/394/head#subdirectory=event_seat_reserve +odoo-addon-event_sale_seat_reserve @ git+https://github.com/OCA/event.git@refs/pull/395/head#subdirectory=event_sale_seat_reserve diff --git a/website_event_sale_seat_reserve/README.rst b/website_event_sale_seat_reserve/README.rst new file mode 100644 index 000000000..becb88553 --- /dev/null +++ b/website_event_sale_seat_reserve/README.rst @@ -0,0 +1,78 @@ +=============================== +Website Event Sale Seat Reserve +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:78323ee06ed8331afd0ba7aac22e975b5057d12b6fa4dc6c8690505562ebf4c5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/website_event_sale_seat_reserve + :alt: OCA/event +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/event-16-0/event-16-0-website_event_sale_seat_reserve + :alt: Translate me on Weblate +.. |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| + +This module allows to make a pre-reserve on registrations after creating a draft order from website. +If a customer add a registration to his cart, the registration will create a draft order and will be +automatically pre-reserved. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Italo LOPES + +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. + +This module is part of the `OCA/event `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_event_sale_seat_reserve/__init__.py b/website_event_sale_seat_reserve/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/website_event_sale_seat_reserve/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_event_sale_seat_reserve/__manifest__.py b/website_event_sale_seat_reserve/__manifest__.py new file mode 100644 index 000000000..8df135244 --- /dev/null +++ b/website_event_sale_seat_reserve/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). +{ + "name": "Website Event Sale Seat Reserve", + "version": "16.0.1.0.0", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/event", + "category": "Marketing", + "summary": "Allow pre-reserve registrations on website sales", + "depends": ["website_event_sale", "event_sale_seat_reserve"], + "installable": True, + "auto_install": False, +} diff --git a/website_event_sale_seat_reserve/models/__init__.py b/website_event_sale_seat_reserve/models/__init__.py new file mode 100644 index 000000000..6f6a9dff3 --- /dev/null +++ b/website_event_sale_seat_reserve/models/__init__.py @@ -0,0 +1 @@ +from . import event_registration diff --git a/website_event_sale_seat_reserve/models/event_registration.py b/website_event_sale_seat_reserve/models/event_registration.py new file mode 100644 index 000000000..2155847c9 --- /dev/null +++ b/website_event_sale_seat_reserve/models/event_registration.py @@ -0,0 +1,21 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). + +from odoo import api, models + + +class EventRegistration(models.Model): + _inherit = "event.registration" + + def _need_pre_reservation(self): + need_pre_reservation = self.sale_order_id and self.sale_order_line_id + + return need_pre_reservation and self.visitor_id + + @api.model_create_multi + def create(self, vals_list): + registrations = super(EventRegistration, self).create(vals_list) + for registration in registrations: + if registration._need_pre_reservation(): + registration.action_set_reserved() + return registrations diff --git a/website_event_sale_seat_reserve/readme/CONTRIBUTORS.rst b/website_event_sale_seat_reserve/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..04b04faf0 --- /dev/null +++ b/website_event_sale_seat_reserve/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Italo LOPES diff --git a/website_event_sale_seat_reserve/readme/DESCRIPTION.rst b/website_event_sale_seat_reserve/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b643ff7b5 --- /dev/null +++ b/website_event_sale_seat_reserve/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows to make a pre-reserve on registrations after creating a draft order from website. +If a customer add a registration to his cart, the registration will create a draft order and will be +automatically pre-reserved. diff --git a/website_event_sale_seat_reserve/static/description/icon.png b/website_event_sale_seat_reserve/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/website_event_sale_seat_reserve/static/description/icon.png differ diff --git a/website_event_sale_seat_reserve/static/description/index.html b/website_event_sale_seat_reserve/static/description/index.html new file mode 100644 index 000000000..f69188762 --- /dev/null +++ b/website_event_sale_seat_reserve/static/description/index.html @@ -0,0 +1,422 @@ + + + + + +Website Event Sale Seat Reserve + + + +
+

Website Event Sale Seat Reserve

+ + +

Beta License: AGPL-3 OCA/event Translate me on Weblate Try me on Runboat

+

This module allows to make a pre-reserve on registrations after creating a draft order from website. +If a customer add a registration to his cart, the registration will create a draft order and will be +automatically pre-reserved.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +