diff --git a/event_seat_booking/README.rst b/event_seat_booking/README.rst new file mode 100644 index 000000000..31b651fe0 --- /dev/null +++ b/event_seat_booking/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Event Seat Booking +================== +This module helps you to book seminars, conferences, appointments and +conventions tickets through website. The event managers can add different types +of tickets and screams in the backend of any event. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer : (V16) Junaidul Ansar M, Contact : odoo@cybrosys.com +* Developer : (V16) Anfas Faisal K, Contact : odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/event_seat_booking/__init__.py b/event_seat_booking/__init__.py new file mode 100644 index 000000000..72a0c75bb --- /dev/null +++ b/event_seat_booking/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/event_seat_booking/__manifest__.py b/event_seat_booking/__manifest__.py new file mode 100644 index 000000000..05ee65f3f --- /dev/null +++ b/event_seat_booking/__manifest__.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': 'Event Seat Booking', + 'version': '16.0.1.0.0', + 'category': 'Website', + 'summary': 'The module used to book seats for the event', + 'description': "This module helps you to book seminars, conferences, " + "appointments and conventions tickets through website.The " + "event managers can add different types of tickets and " + "screams in the backend of any event", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'event', 'sale_management', 'website', 'website_event', + 'website_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'data/seat_column_sequence.xml', + 'report/event_report_template_full_page_ticket.xml', + 'views/seat_arrangement_views.xml', + 'views/event_event_ticket_views.xml', + 'views/event_event_views.xml', + 'views/event_registration_views.xml', + 'views/seat_arrangement_line_views.xml', + 'views/registration_template.xml', + 'views/event_seat_booking_board_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'event_seat_booking/static/src/js/templates.js', + 'event_seat_booking/static/src/js/register.js', + 'event_seat_booking/static/src/css/template.css', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, + 'auto_install': False +} diff --git a/event_seat_booking/controllers/__init__.py b/event_seat_booking/controllers/__init__.py new file mode 100644 index 000000000..4c6996ffa --- /dev/null +++ b/event_seat_booking/controllers/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import event_seat_booking +from . import website_event +from . import website_sale diff --git a/event_seat_booking/controllers/event_seat_booking.py b/event_seat_booking/controllers/event_seat_booking.py new file mode 100644 index 000000000..ef1fabdb7 --- /dev/null +++ b/event_seat_booking/controllers/event_seat_booking.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import http, _ +from odoo.http import request + + +class SeatBookingController(http.Controller): + """The controller handle for the event seat booking page""" + + @http.route(['''/event//SeatsBooking'''], + type='http', auth='public', website=True) + def seat_booking_page(self, event): + """It displays the seat booking information """ + # Fetch the seat arrangement lines related to the event or + # user(based on your requirement) + event_tickets = request.env['event.event.ticket'].search([ + ('event_id', '=', event.id), + ]) + event_seat_templates = {} + for ticket in event_tickets: + seat_arrangement_lines = ticket.seat_arrangement_id.prepare_seat_ids + event_seat_template = {} + + for line in seat_arrangement_lines: + row_no = line.row_no + if row_no not in event_seat_template: + event_seat_template[row_no] = [] + + for column in line.column_ids: + seat_data = { + 'seat_column_id': column.column_no, + 'reservation_status': column.reservation_status, + 'row_no': row_no, + 'column_no': column.column_no, + 'unique_column': column.unique_seat_identifier + } + event_seat_template[row_no].append(seat_data) + + event_seat_templates[ + ticket.seat_arrangement_id.id] = event_seat_template + return request.render( + 'event_seat_booking.event_seat_booking_board_templates', + { + 'event_name': event.name, + 'event': event.id, + 'event_tickets': event_tickets, + 'event_seat_templates': event_seat_templates, + }) diff --git a/event_seat_booking/controllers/website_event.py b/event_seat_booking/controllers/website_event.py new file mode 100644 index 000000000..345b4fb9f --- /dev/null +++ b/event_seat_booking/controllers/website_event.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import _ +from odoo.http import request +from odoo.addons.website_event.controllers.main import WebsiteEventController + + +class WebsiteEventController(WebsiteEventController): + def _process_tickets_form(self, event, form_details): + """ Process posted data about ticket order. Generic ticket are supported + for event without tickets (generic registration). + + :return: list of order per ticket: [{ + 'id': if of ticket if any (0 if no ticket), + 'ticket': browse record of ticket if any (None if no ticket), + 'name': ticket name (or generic 'Registration' name if no ticket), + 'quantity': number of registrations for that ticket, + }, {...}] + """ + ticket_order = {} + + for key, value in form_details.items(): + registration_items = key.split('nb_register-') + if len(registration_items) != 2: + continue + ticket_order[int(registration_items[1])] = int(value) + + ticket_dict = dict((ticket.id, ticket) for ticket in + request.env['event.event.ticket'].sudo().search([ + ('id', 'in', + [tid for tid in ticket_order.keys() if tid]), + ('event_id', '=', event.id) + ])) + # Process seat details + unique_ids = form_details.get('unique_id', '').split(',') + if not unique_ids or unique_ids == ['']: + order = [{ + 'id': tid if ticket_dict.get(tid) else 0, + 'ticket': ticket_dict.get(tid), + 'name': ticket_dict[tid]['name'] if ticket_dict.get( + tid) else _('Registration'), + 'quantity': count, + } for tid, count in ticket_order.items() if count] + return order + + column_numbers = form_details.get('column_no', []) + row_numbers = form_details.get('row_no', []) + + order = [] + for tid, count in ticket_order.items(): + seat_details = [] + for i in range(count): + index = sum(ticket_order[key] for key in ticket_order.keys() if + key < tid) + i + if index < len(unique_ids): + seat_details.append({ + 'unique_id': unique_ids[index], + 'row_no': row_numbers[index], + 'column_no': column_numbers[index], + }) + + order.append({ + 'id': tid if ticket_dict.get(tid) else 0, + 'ticket': ticket_dict.get(tid), + 'name': ticket_dict[tid]['name'] if ticket_dict.get( + tid) else _('Registration'), + 'quantity': count, + 'seat_details': seat_details, + }) + return order diff --git a/event_seat_booking/controllers/website_sale.py b/event_seat_booking/controllers/website_sale.py new file mode 100644 index 000000000..2e2c9c06b --- /dev/null +++ b/event_seat_booking/controllers/website_sale.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import http +from odoo.http import request +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class PaymentController(WebsiteSale): + @http.route('/shop/payment/validate', type='http', auth="public", + website=True, sitemap=False) + def shop_payment_validate(self, sale_order_id=None, **post): + """ + Validates the payment for the sale order and updates the seat + reservation status for event-related products. Overrides the default + `shop_payment_validate` method from `WebsiteSale` to handle seat + booking reservations. + """ + res = super( + PaymentController, self).shop_payment_validate( + sale_order_id=sale_order_id, **post) + last_order_id = request.session['sale_last_order_id'] + order = request.env['sale.order'].sudo().browse(last_order_id).exists() + for line in order.order_line: + if line.product_id.detailed_type == 'event': + if line.event_id.is_seat_booking: + event_id_ticket = line.event_ticket_id.id + registrations = request.env[ + 'event.registration'].sudo().search( + [('sale_order_line_id', '=', line.id)]) + for registration in registrations: + unique_column_id = registration.unique_column_id + seat_record = request.env[ + 'seat.arrangement.line'].sudo().search([ + ('seat_manage_id.current_event_id', '=', + event_id_ticket), + ]) + if seat_record: + column_record = seat_record.column_ids.filtered( + lambda + c: c.unique_seat_identifier == unique_column_id) + column_record.write( + {'reservation_status': 'reserved'}) + return res diff --git a/event_seat_booking/data/seat_column_sequence.xml b/event_seat_booking/data/seat_column_sequence.xml new file mode 100644 index 000000000..50ec4df45 --- /dev/null +++ b/event_seat_booking/data/seat_column_sequence.xml @@ -0,0 +1,13 @@ + + + + + + Seat Column + seat.column + SN + 4 + + + + diff --git a/event_seat_booking/doc/RELEASE_NOTES.md b/event_seat_booking/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..191dc4eee --- /dev/null +++ b/event_seat_booking/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 18.06.2024 +#### Version 16.0.1.0.0 +#### ADD + +- Initial Commit For Event Seat Booking. diff --git a/event_seat_booking/models/__init__.py b/event_seat_booking/models/__init__.py new file mode 100644 index 000000000..724a9dd0c --- /dev/null +++ b/event_seat_booking/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import event_event +from . import event_event_ticket +from . import seat_arrangement +from . import seat_arrangement_line +from . import seat_column +from . import event_registration diff --git a/event_seat_booking/models/event_event.py b/event_seat_booking/models/event_event.py new file mode 100644 index 000000000..b6576db86 --- /dev/null +++ b/event_seat_booking/models/event_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class EventEvent(models.Model): + """Inheriting the module and add a field to enabling the event seat booking + register button to the website""" + _inherit = 'event.event' + + is_seat_booking = fields.Boolean(string="Is Seat Booking ?", + help='Seat booking enable or not.') diff --git a/event_seat_booking/models/event_event_ticket.py b/event_seat_booking/models/event_event_ticket.py new file mode 100644 index 000000000..455d7b637 --- /dev/null +++ b/event_seat_booking/models/event_event_ticket.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class EventEventTicket(models.Model): + """Inheriting the module to add a field""" + _inherit = 'event.event.ticket' + + total_row = fields.Integer(string="Total Row", + help='Total row used in this event.') + sequence = fields.Integer(string='Sequence', help='Drag the records') + seat_arrangement_id = fields.Many2one('seat.arrangement', + string='Seat Arrangement Id', + help='Seat arrangement model ' + 'reference') + + def seat_arrangement_action(self): + """Opening the seat arrangement model""" + context = self.env.context + default_seat_arrangement_id = context.get( + 'default_seat_arrangement_id', + False) + if default_seat_arrangement_id: + return { + 'type': 'ir.actions.act_window', + 'res_model': 'seat.arrangement', + 'view_mode': 'form', + 'res_id': default_seat_arrangement_id, + 'target': 'new', + } + else: + return { + 'type': 'ir.actions.act_window', + 'res_model': 'seat.arrangement', + 'view_mode': 'form', + 'target': 'new', + } diff --git a/event_seat_booking/models/event_registration.py b/event_seat_booking/models/event_registration.py new file mode 100644 index 000000000..78082455c --- /dev/null +++ b/event_seat_booking/models/event_registration.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class EventRegistration(models.Model): + _inherit = 'event.registration' + + row_number = fields.Char(string="Row Number", help="Row Number he booked", + readonly=True) + column_number = fields.Char(string="Column Number", + help="Column Number he booked", readonly=True) + unique_column_id = fields.Char(string="Unique Column Number", + help="Column Number ID he booked", + readonly=True) + complete_name = fields.Char(string="Seat No", + compute='_compute_seat_name', store=True) + + @api.depends('row_number', 'column_number') + def _compute_seat_name(self): + """Compute the complete seat name based on row and column numbers.""" + for record in self: + rec_name = f"R{record.row_number or ''} S{record.column_number or ''}" + record.complete_name = rec_name.strip() + + def _get_website_registration_allowed_fields(self): + """Get the fields allowed for website registration.""" + return {'name', 'phone', 'email', 'mobile', 'event_id', 'partner_id', + 'event_ticket_id', 'row_number', 'column_number', + 'unique_column_id'} + + def action_cancel(self): + """Cancel the event registration and update the seat reservation + status to 'available'.""" + + res = super(EventRegistration,self).action_cancel() + unique_column_id = self.unique_column_id + seat_record = self.env[ + 'seat.arrangement.line'].sudo().search([ + ('seat_manage_id.current_event_id', '=', self.event_ticket_id.id), + ]) + if seat_record: + column_record = seat_record.column_ids.filtered( + lambda c: c.unique_seat_identifier == unique_column_id) + column_record.write({'reservation_status': 'available'}) + return res + + def action_confirm(self): + """Confirm the event registration and update the seat + reservation status to 'booked'.""" + res = super(EventRegistration,self).action_confirm() + unique_column_id = self.unique_column_id + seat_record = self.env[ + 'seat.arrangement.line'].sudo().search([ + ('seat_manage_id.current_event_id', '=', self.event_ticket_id.id), + ]) + if seat_record: + # for col in seat_record.column_ids: + column_record = seat_record.column_ids.filtered( + lambda c: c.unique_seat_identifier == unique_column_id) + column_record.write({'reservation_status': 'booked'}) + + return res diff --git a/event_seat_booking/models/seat_arrangement.py b/event_seat_booking/models/seat_arrangement.py new file mode 100644 index 000000000..fe75c97f4 --- /dev/null +++ b/event_seat_booking/models/seat_arrangement.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class SeatArrangement(models.Model): + """This class handle to the seat arrangement details.""" + _name = 'seat.arrangement' + _description = 'Seat Arrangement' + + event = fields.Char(string='Event', help='Current event name.', + readonly=True) + ticket_type = fields.Char(string='Ticket Type', + help='Current event type.', readonly=True) + total_row = fields.Integer(string='Total Row', + help='Enter total row of this ticket type ' + 'in screen.') + max_seat_single_row = fields.Integer(string='Max Seat Number in Single Row', + help='Enter maximum number of seat in ' + 'single row of particular this' + ' ticket type.') + prepare_seat_ids = fields.One2many('seat.arrangement.line', + 'seat_manage_id', + string='Arranged Seat' + ) + seats_max = fields.Integer(string="Maximum Attendees", + help='Define number of available tickets.') + current_event_id = fields.Integer(string='Event ID', + help='Get current event id.', + readonly=True) + + def action_create_one_two_many_record(self): + """Create seat records based on total_row and max_seat_single_row.""" + # Clear existing seat records before creating new ones + if self.prepare_seat_ids: + self.prepare_seat_ids.unlink() + # Create seat.column records if they don't already exist + if not self.env['seat.column'].search([]): + for column_num in range(1, self.max_seat_single_row + 1): + d = self.env['seat.column'].create({'column_no': column_num}) + row = 1 + while row <= self.total_row: + seat_line_ids = [] + # Case 1: When both blank_row and blank_seat are not enabled + for column_num in range(1, self.max_seat_single_row + 1): + column_record = self.env['seat.column'].create( + {'column_no': column_num}) + seat_line_ids.append((4, column_record.id)) + # Create the seat arrangement line + self.env['seat.arrangement.line'].create({ + 'row_no': row, + 'column_ids': seat_line_ids if seat_line_ids else None, + 'seat_manage_id': self.id + }) + row += 1 + cr = self.env.cr + # updating the maximum seat + query = f"""select count(seat_column_id) from seat_arrangement_line as a + join seat_arrangement_line_seat_column_rel as b on + a.id=b.seat_arrangement_line_id join seat_arrangement as c on + c.id=a.seat_manage_id where a.seat_manage_id = {self.id}""" + cr.execute(query) + seat_count = cr.fetchone()[0] + self.seats_max = seat_count + return { + 'type': 'ir.actions.act_window', + 'res_model': 'seat.arrangement', + 'view_mode': 'form', + 'res_id': self.id, + 'target': 'new', + } + + def action_clear_seat_arrangement(self): + """Clear the entire seat arrangement.""" + self.prepare_seat_ids.unlink() + return { + 'type': 'ir.actions.act_window', + 'res_model': 'seat.arrangement', + 'view_mode': 'form', + 'res_id': self.id, + 'target': 'new', + } + + def action_save_record(self): + """Save button to save the seat arrangement details""" + event_ticket = self.env['event.event.ticket'].browse( + self.current_event_id) + if event_ticket: + event_ticket.write({ + 'total_row': self.total_row, + 'seats_max': self.seats_max, + 'seat_arrangement_id': self.id + }) diff --git a/event_seat_booking/models/seat_arrangement_line.py b/event_seat_booking/models/seat_arrangement_line.py new file mode 100644 index 000000000..3a39ce9cf --- /dev/null +++ b/event_seat_booking/models/seat_arrangement_line.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class SeatArrangementLine(models.Model): + """Prepared seat based on the row and column count""" + _name = 'seat.arrangement.line' + _description = 'Seat Arrangement Line' + + row_no = fields.Integer(string='Row No', help='Enter the row Number.') + column_ids = fields.Many2many('seat.column', + string='Column Selection', + help='Selected Columns.') + seat_manage_id = fields.Many2one('seat.arrangement', + string='Arrange seat', + help='Seat arrangement co-model.') + reservation_status = fields.Selection([ + ('available', 'Available'), + ('reserved', 'Reserved'), + ('booked', 'Booked'), + ], string='Reservation Status', default='available') + + def action_delete_row(self): + """Delete the current seat arrangement line.""" + skip_save = self.env.context.get('seat_arrangement_skip_save', False) + self.unlink() + if not skip_save: + self.env.cr.commit() diff --git a/event_seat_booking/models/seat_column.py b/event_seat_booking/models/seat_column.py new file mode 100644 index 000000000..b7b95d081 --- /dev/null +++ b/event_seat_booking/models/seat_column.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Junaidul Ansar M () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class SeatColumn(models.Model): + """Column selection creation""" + _name = 'seat.column' + _description = 'Seat Column' + _rec_name = 'column_no' + + unique_seat_identifier = fields.Char(string='Unique Seat Identifier', + readonly=True) + + column_no = fields.Integer(string='Column Number', + help='Enter column number.') + + reservation_status = fields.Selection([ + ('available', 'Available'), + ('reserved', 'Reserved'), + ('booked', 'Booked'), + ], string='Reservation Status', default='available') + + @api.model + def create(self, vals): + vals['unique_seat_identifier'] = self.env['ir.sequence'].next_by_code( + 'seat.column') + return super(SeatColumn, self).create(vals) diff --git a/event_seat_booking/report/event_report_template_full_page_ticket.xml b/event_seat_booking/report/event_report_template_full_page_ticket.xml new file mode 100644 index 000000000..af5ce5633 --- /dev/null +++ b/event_seat_booking/report/event_report_template_full_page_ticket.xml @@ -0,0 +1,31 @@ + + + + + + \ No newline at end of file diff --git a/event_seat_booking/security/ir.model.access.csv b/event_seat_booking/security/ir.model.access.csv new file mode 100644 index 000000000..2175ddeea --- /dev/null +++ b/event_seat_booking/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_seat_arrangement_user,access.seat.arrangement.user,model_seat_arrangement,base.group_user,1,1,1,1 +access_seat_arrangement_line_user,access.seat.arrangement.line.user,model_seat_arrangement_line,base.group_user,1,1,1,1 +access_seat_column_user,access.seat.column.user,model_seat_column,base.group_user,1,1,1,1 diff --git a/event_seat_booking/static/description/assets/icons/check.png b/event_seat_booking/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/check.png differ diff --git a/event_seat_booking/static/description/assets/icons/chevron.png b/event_seat_booking/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/chevron.png differ diff --git a/event_seat_booking/static/description/assets/icons/cogs.png b/event_seat_booking/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/cogs.png differ diff --git a/event_seat_booking/static/description/assets/icons/consultation.png b/event_seat_booking/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/consultation.png differ diff --git a/event_seat_booking/static/description/assets/icons/ecom-black.png b/event_seat_booking/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/ecom-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/education-black.png b/event_seat_booking/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/education-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/hotel-black.png b/event_seat_booking/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/hotel-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/license.png b/event_seat_booking/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/license.png differ diff --git a/event_seat_booking/static/description/assets/icons/lifebuoy.png b/event_seat_booking/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/lifebuoy.png differ diff --git a/event_seat_booking/static/description/assets/icons/manufacturing-black.png b/event_seat_booking/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/manufacturing-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/pos-black.png b/event_seat_booking/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/pos-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/puzzle.png b/event_seat_booking/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/puzzle.png differ diff --git a/event_seat_booking/static/description/assets/icons/restaurant-black.png b/event_seat_booking/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/restaurant-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/service-black.png b/event_seat_booking/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/service-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/trading-black.png b/event_seat_booking/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/trading-black.png differ diff --git a/event_seat_booking/static/description/assets/icons/training.png b/event_seat_booking/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/training.png differ diff --git a/event_seat_booking/static/description/assets/icons/update.png b/event_seat_booking/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/update.png differ diff --git a/event_seat_booking/static/description/assets/icons/user.png b/event_seat_booking/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/user.png differ diff --git a/event_seat_booking/static/description/assets/icons/wrench.png b/event_seat_booking/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/event_seat_booking/static/description/assets/icons/wrench.png differ diff --git a/event_seat_booking/static/description/assets/misc/categories.png b/event_seat_booking/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/categories.png differ diff --git a/event_seat_booking/static/description/assets/misc/check-box.png b/event_seat_booking/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/check-box.png differ diff --git a/event_seat_booking/static/description/assets/misc/compass.png b/event_seat_booking/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/compass.png differ diff --git a/event_seat_booking/static/description/assets/misc/corporate.png b/event_seat_booking/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/corporate.png differ diff --git a/event_seat_booking/static/description/assets/misc/customer-support.png b/event_seat_booking/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/customer-support.png differ diff --git a/event_seat_booking/static/description/assets/misc/cybrosys-logo.png b/event_seat_booking/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/cybrosys-logo.png differ diff --git a/event_seat_booking/static/description/assets/misc/features.png b/event_seat_booking/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/features.png differ diff --git a/event_seat_booking/static/description/assets/misc/logo.png b/event_seat_booking/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/logo.png differ diff --git a/event_seat_booking/static/description/assets/misc/pictures.png b/event_seat_booking/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/pictures.png differ diff --git a/event_seat_booking/static/description/assets/misc/pie-chart.png b/event_seat_booking/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/pie-chart.png differ diff --git a/event_seat_booking/static/description/assets/misc/right-arrow.png b/event_seat_booking/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/right-arrow.png differ diff --git a/event_seat_booking/static/description/assets/misc/star.png b/event_seat_booking/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/star.png differ diff --git a/event_seat_booking/static/description/assets/misc/support.png b/event_seat_booking/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/support.png differ diff --git a/event_seat_booking/static/description/assets/misc/whatsapp.png b/event_seat_booking/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/event_seat_booking/static/description/assets/misc/whatsapp.png differ diff --git a/event_seat_booking/static/description/assets/modules/1.jpg b/event_seat_booking/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..291635d04 Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/1.jpg differ diff --git a/event_seat_booking/static/description/assets/modules/2.jpg b/event_seat_booking/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..157e5a4d4 Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/2.jpg differ diff --git a/event_seat_booking/static/description/assets/modules/3.png b/event_seat_booking/static/description/assets/modules/3.png new file mode 100644 index 000000000..6e487b48c Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/3.png differ diff --git a/event_seat_booking/static/description/assets/modules/4.png b/event_seat_booking/static/description/assets/modules/4.png new file mode 100644 index 000000000..bd1a82caa Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/4.png differ diff --git a/event_seat_booking/static/description/assets/modules/5.jpg b/event_seat_booking/static/description/assets/modules/5.jpg new file mode 100755 index 000000000..15892a150 Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/5.jpg differ diff --git a/event_seat_booking/static/description/assets/modules/7.jpg b/event_seat_booking/static/description/assets/modules/7.jpg new file mode 100644 index 000000000..483dd03a4 Binary files /dev/null and b/event_seat_booking/static/description/assets/modules/7.jpg differ diff --git a/event_seat_booking/static/description/assets/screenshots.zip b/event_seat_booking/static/description/assets/screenshots.zip new file mode 100644 index 000000000..c77f41842 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots.zip differ diff --git a/event_seat_booking/static/description/assets/screenshots/1.png b/event_seat_booking/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..cd4fda386 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/1.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/10.png b/event_seat_booking/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..09b41c59e Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/10.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/11.png b/event_seat_booking/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..4d5dc85bc Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/11.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/12.png b/event_seat_booking/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..95ba97b9a Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/12.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/13.png b/event_seat_booking/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..128be0120 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/13.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/14.png b/event_seat_booking/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..0292f56f9 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/14.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/15.png b/event_seat_booking/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..73644e823 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/15.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/16.png b/event_seat_booking/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..1322fe4f9 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/16.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/17.png b/event_seat_booking/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..aa77e9b45 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/17.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/2.png b/event_seat_booking/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..be5d9ccc8 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/2.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/3.png b/event_seat_booking/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..c8527ccc9 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/3.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/4.png b/event_seat_booking/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6f181622e Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/4.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/5.png b/event_seat_booking/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..69fe6a870 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/5.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/6.png b/event_seat_booking/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..0c9c348b8 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/6.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/7.png b/event_seat_booking/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..569fe4f98 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/7.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/8.png b/event_seat_booking/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..651bd1082 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/8.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/9.png b/event_seat_booking/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..f5ff91a60 Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/9.png differ diff --git a/event_seat_booking/static/description/assets/screenshots/v16-hero (1).gif b/event_seat_booking/static/description/assets/screenshots/v16-hero (1).gif new file mode 100644 index 000000000..7cc37d16f Binary files /dev/null and b/event_seat_booking/static/description/assets/screenshots/v16-hero (1).gif differ diff --git a/event_seat_booking/static/description/banner.jpg b/event_seat_booking/static/description/banner.jpg new file mode 100644 index 000000000..2b4c05037 Binary files /dev/null and b/event_seat_booking/static/description/banner.jpg differ diff --git a/event_seat_booking/static/description/icon.png b/event_seat_booking/static/description/icon.png new file mode 100644 index 000000000..f9d3b0fac Binary files /dev/null and b/event_seat_booking/static/description/icon.png differ diff --git a/event_seat_booking/static/description/index.html b/event_seat_booking/static/description/index.html new file mode 100644 index 000000000..6f765b6fd --- /dev/null +++ b/event_seat_booking/static/description/index.html @@ -0,0 +1,711 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Event Seat Booking +

+

+ The Module Used to Book Seats for the Event

+ + +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+This module helps you to book seminars, conferences, appointments and +conventions. The event managers can add different types of tickets and screams +in the backend of any event. The event manager can arrange the seat as per +the needs, and they can know the name of every participant and full details. +You can add the event questionnaire before attending the event and the event +manager can switch the seat before the confirmation.The attached have to +select just the seat with the total price.After that registration and last is +payment. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+ +
+ + Easy to manage online event ticket seat booking. + +
+ +
+ + The admin can arrange the seat as per the event. . + +
+
+ + You can generate full page ticket report & foldable badge report. + + +
+ +
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Event Creation. +

+

+ After Install the Module + Go to Event module -> Select an Event -> + -> + Inside that Event we can see the 'Open Seat Arrangement' list view icon to the Ticket page. + Click that button you can arrange the Event Seat. +

+ +
+ +
+

+ Event Seat Arrangement. +

+

+ Inside this model, you can arrange the event seats according to your needs.

+ +
+ +
+

+ After Seat Arrangement. +

+

+ After the Seat Arrangement enable the 'Is Seat Booking' Boolean field + to enable the booking through Website. +

+ +
+ +
+

+ Website View. +

+

+ Click the "Seat Booking" Option to view the Seat Arrangement +

+ +
+ +
+

+ Event Seat Booking View. +

+ +
+
+

+ Select the seats you want to book and Click on the "Register" Button. +

+ +
+
+

+ After that, it open a wizard and enter the attendees details and then Click the "Continue" Button. +

+ +
+
+

+ Select the payment method and press the "Pay Now " button. +

+ +
+
+

+ Booked Seats are marked with red color, if payment is not done then the seat will not be marked as booked. +

+ +
+
+

+ Now go to the event Backend and click on the Attendees Button to see the attendee's detail. +

+ +
+
+

+ The Seat No details will be shown in tree view. +

+ +
+
+

+ The Seat No details will be shown in form view. +

+ +
+
+

+ You can print full page ticket from Print. +

+ +
+
+

+ Full page Ticket. +

+ +
+
+

+ You can print foldable page ticket from Print. +

+ +
+
+

+ Foldable page Ticket +

+ +
+
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/event_seat_booking/static/src/css/template.css b/event_seat_booking/static/src/css/template.css new file mode 100644 index 000000000..158a95f21 --- /dev/null +++ b/event_seat_booking/static/src/css/template.css @@ -0,0 +1,73 @@ +.event_seat_arrangemet{ + display: flex; + flex-direction: column; + justify-content: center; + align-items: normal; + width:100%; +} +.separate-event{ + width: 0%; +} +/*.seats-row { + text-align: center; + justify-content: center; + display: flex; + flex-direction: column; + align-items: center; + }*/ + .seats-column{ + display: flex; + gap: 5px; + } + .seat-button { + width: 30px; + height: 30px; + border: 1px solid #000; + color: white; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + margin: 6px; + } + .row-button { + width: 30px; + height: 30px; + border: 1px solid #000; + background-color: gray; + color: white; + display: flex; + align-items: center; + justify-content: center; + margin: 6px; + } + .seat-button.selected { + background-color: pink; + } + .print-clean { + border: none; + background: transparent; + } + .event-button { + width: 30px; + height: 30px; + border: 1px solid #000; + color: white; + display: flex; + align-items: center; + justify-content: center; + } +.VIP { + background-color: darksalmon; +} + +.Standard { + background-color: #b9dea0; +} + +.Free { + background-color: #3a78c3; +} +.confirmed-seat { + background-color: brown; +} diff --git a/event_seat_booking/static/src/js/register.js b/event_seat_booking/static/src/js/register.js new file mode 100644 index 000000000..0ad453460 --- /dev/null +++ b/event_seat_booking/static/src/js/register.js @@ -0,0 +1,81 @@ +odoo.define('event_seat_booking.register', function (require) { + 'use strict'; + + var core = require('web.core'); + var event = require('website_event.website_event'); + var _t = core._t; + var ajax = require('web.ajax'); + + event.include({ + init: function () { + this._super.apply(this, arguments); // Call the parent's init method if needed + }, + //Handles the click event on the registration form, processes the form data, and makes an AJAX request + // to submit the form. It also includes additional logic for seat booking. + on_click: function (ev) { + ev.preventDefault(); + ev.stopPropagation(); + var $form = $(ev.currentTarget).closest('form'); + var $target = $(ev.currentTarget); + var $button = $(ev.currentTarget).closest('[type="submit"]'); + var post = {}; + $('#registration_form table').siblings('.alert').remove(); + $('#registration_form select').each(function () { + post[$(this).attr('name')] = $(this).val(); + console.log(post,"VALUES") + }); + var tickets_ordered = _.some(_.map(post, function (value, key) { return parseInt(value); })); + if (!tickets_ordered) { + $('
') + .text(_t('Please select at least one ticket.')) + .insertAfter('#registration_form table'); + return new Promise(function () {}); + } else { + var uniqueId = $('#unique_column_id').val(); + if (!uniqueId) { + this._super(ev); + return; + } + + var columnNumbers = $('#col_number_id').val(); // + var rowNumbers = $('#row_number_id').val(); + + var colNumbers = columnNumbers.match(/C(\d+)/g).map(e => e.substring(1)); // ['2', '3'] + var rowNumbersExtracted = rowNumbers.match(/R(\d+)/g).map(e => e.substring(1)); // ['4', '4'] + + post['unique_id'] = uniqueId; + post['row_no'] = rowNumbersExtracted; + post['column_no'] = colNumbers; + + var colNumbers = columnNumbers.match(/C(\d+)/g).map(e => e.substring(1)); // ['2', '3'] + var rowNumbersExtracted = rowNumbers.match(/R(\d+)/g).map(e => e.substring(1)); // ['4', '4'] + $button.attr('disabled', true); + var action = $form.data('action') || $form.attr('action'); + return ajax.jsonRpc(action, 'call', post).then(function (modal) { + var $modal = $(modal); + $modal.find('.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19 + const hidden_div = $modal.find('.ticket_essentials')[0] + const $hiddenDiv = $(hidden_div); + const rowNumberInput = $hiddenDiv.find('input[name="row_number"]')[0]; + const columnNumberInput = $hiddenDiv.find('input[name="column_number"]')[0]; + const uniqueIdInput = $hiddenDiv.find('input[name="unique_id"]')[0]; + + $modal.appendTo(document.body); + const modalBS = new Modal($modal[0], {backdrop: 'static', keyboard: false}); + modalBS.show(); + $modal.appendTo('body').modal('show'); + $modal.on('click', '.js_goto_event', function () { + $modal.modal('hide'); + $button.prop('disabled', false); + }); + $modal.on('click', '.btn-close', function () { + $button.prop('disabled', false); + }); + }); + } + }, + + }); +}); + + diff --git a/event_seat_booking/static/src/js/templates.js b/event_seat_booking/static/src/js/templates.js new file mode 100644 index 000000000..aec9a34bc --- /dev/null +++ b/event_seat_booking/static/src/js/templates.js @@ -0,0 +1,140 @@ +odoo.define('event_seat_booking.templates', function (require) { + 'use strict'; + var publicWidget = require('web.public.widget'); + var ajax = require('web.ajax'); + var core = require('web.core'); + var _t = core._t; + + publicWidget.registry.SeatBooking = publicWidget.Widget.extend({ + selector: '.main', + events: { + 'click .seat-button': '_onSeatClick', + }, + init: function () { + this._super.apply(this, arguments); + this.selectedSeats = []; + this.seatCount = 0; + this.totalPrice = 0; + this.eventPrices = {}; // Dictionary to store event prices + this.seatInformation = {}; + }, + //Seat onClick + _onSeatClick: function (ev) { + const seatButton = document.querySelector('.seat-button'); + const eventId = seatButton.getAttribute('data-event-id'); + var $target = $(ev.currentTarget); + var ticketId = $target.data('event-id'); + var uniqueId = $target.data('seat-id'); + var seatCount = $target.hasClass('selected') ? 0 : 0; + // Update the seat count for the ticket ID in the object + this.eventPrices[ticketId] = (this.eventPrices[ticketId] || 0) + seatCount; + var seatCount = 0; + var rowNumber = $target.closest('.seats-column').find('.row-button').text().trim(); + var seatNumber = $target.text().trim(); + var eventName = $target.data('event-name'); + var eventPrice = parseFloat($target.data('event-price')); + var selectedSeats = []; + // Check if eventPrice is NaN (zero) and handle accordingly + if (isNaN(eventPrice)) { + eventPrice = 0; + } + //if reserved seat show alert + + if ($target.hasClass('reserved-seat')) { + alert('This seat is already booked. Please choose another seat.'); + + return; // Do nothing if the seat is confirmed + } + // Toggle the "selected" class on the seat-button + $target.toggleClass('selected'); + // Show or hide the seat information in the selected-seats div based on the selected state + var seatInfo = eventName + ' Seat' + '#' + 'R' + rowNumber + 'S' + seatNumber + ':' + eventPrice + "
" ; + var SeatID = 'Row' + rowNumber + 'Column' + seatNumber + var uniqueRowKey = uniqueId + 'R' + rowNumber; + var uniqueColumnKey = uniqueId + 'C' + seatNumber + if ($target.hasClass('selected')) { + // Add the uniqueId to the text input field + var currentValue = this.$('#unique_column_id').val(); + var newValue = currentValue ? currentValue + ',' + uniqueId : uniqueId; + this.$('#unique_column_id').val(newValue); + // Add the uniqueRowKey to the row_number_id input field + var currentRowNumberValue = this.$('#row_number_id').val(); + var newRowNumberValue = currentRowNumberValue ? currentRowNumberValue + ',' + uniqueRowKey : uniqueRowKey; + this.$('#row_number_id').val(newRowNumberValue); + // Add the seatNumber to the col_number_id input field + var currentColNumberValue = this.$('#col_number_id').val(); + var newColNumberValue = currentColNumberValue ? currentColNumberValue + ',' + uniqueColumnKey : uniqueColumnKey; + this.$('#col_number_id').val(newColNumberValue); + this.seatCount += $target.hasClass('selected') ? 1 : 0; + this.eventPrices[ticketId] = (this.eventPrices[ticketId] || 0) + 1; + + $('.seat-count').html(this.seatCount); + this.totalPrice += $target.hasClass('selected') ? eventPrice : -eventPrice; + $('.total').html(this.totalPrice); + var seatDetail = $('
').addClass('seat-detail'); + seatDetail.append(seatInfo); + $('.selected-seats').append(seatDetail); + } + else { + // Handle the case where the seat is deselected + var currentValue = $('#unique_column_id').val(); + var newValue = currentValue.split(',').filter(function(value) { + return value !== uniqueId; + }).join(','); + $('#unique_column_id').val(newValue) + + // Remove the seatNumber from the col_number_id input field + var currentColNumberValue = $('#col_number_id').val(); + var newColNumberValue = currentColNumberValue.split(',').filter(function(value) { + return value !== uniqueColumnKey; + }).join(','); + $('#col_number_id').val(newColNumberValue); + + // Remove the uniqueRowKey from the row_number_id input field + var currentRowNumberValue = $('#row_number_id').val(); + var newRowNumberValue = currentRowNumberValue.split(',').filter(function(value) { + return value !== uniqueRowKey; + }).join(','); + $('#row_number_id').val(newRowNumberValue); + + this.seatCount += $target.hasClass('selected') ? 0 : -1; + this.eventPrices[ticketId] = (this.eventPrices[ticketId] || 0) + -1; + $('.seat-count').html(this.seatCount); + this.totalPrice -= eventPrice; + $('.total').html(this.totalPrice); + var seatToRemove = $('.seat-detail').eq(rowNumber - 1); + seatToRemove.remove(); + } + if (this.seatCount === 0) { + $('.seat-detail').html(''); + + } + // Collect selected seat numbers + this.$('.seat-button.selected').each(function () { + var rowNumber = $(this).closest('.seats-column').find('.row-button').text(); + var seatNumber = $(this).text(); + selectedSeats.push("R" + rowNumber.trim() + "S" + seatNumber.trim() ); + }); + + // Attach selected seat numbers to the register button + $('#all_selected-seats').html(selectedSeats.join(', ')); + console.log(this.$('#all_selected-seats'),"the seats") + var $nearestSelect = $target.closest('.separate-event').find('#selected_seats_input'); // Find the parent select tag + console.log($nearestSelect,34432432) + $nearestSelect.empty(); + for (var id in this.eventPrices) { + if (this.eventPrices.hasOwnProperty(id)) { + var optionValue = id; // Use the ticket ID as the option value + var optionText = optionValue + ': ' + this.eventPrices[id]; + $nearestSelect.append($('