diff --git a/show_booking_management/README.rst b/show_booking_management/README.rst new file mode 100644 index 000000000..60d4624da --- /dev/null +++ b/show_booking_management/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Show Booking Management +======================= +A module for show booking management. Admin can manage shows and Users +can book shows easily through Website by selecting date, screen, time and seats. + +Configuration +============= +- No configuration needed + +License +======= +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V17) Ashwin A, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : http://www.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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/show_booking_management/__init__.py b/show_booking_management/__init__.py new file mode 100644 index 000000000..3a4040ec4 --- /dev/null +++ b/show_booking_management/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 controller +from . import models diff --git a/show_booking_management/__manifest__.py b/show_booking_management/__manifest__.py new file mode 100644 index 000000000..7a3a5d906 --- /dev/null +++ b/show_booking_management/__manifest__.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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': "Show Booking Management", + 'version': '17.0.1.0.0', + 'category': 'Services', + 'summary': "Manage shows and book shows easily.", + 'description': """A module for show booking management. Admin can manage shows + and Users can book shows easily through Website by selecting date, + screen, time and seats.""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['stock', 'website_sale', 'account', 'portal'], + 'data': [ + 'security/show_booking_management_groups.xml', + 'security/ir.model.access.csv', + 'data/product_product_data.xml', + 'data/report_paperformat_data.xml', + 'data/mail_template_data.xml', + 'data/ir_sequence_data.xml', + 'data/website_menu_data.xml', + 'views/movie_movie_views.xml', + 'views/show_type_views.xml', + 'views/cast_type_views.xml', + 'views/movie_cast_views.xml', + 'views/time_slots_views.xml', + 'views/movie_screen_views.xml', + 'views/movie_registration_views.xml', + 'views/website_templates.xml', + 'views/portal_template.xml', + 'report/movie_registration_templates.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'show_booking_management/static/src/js/time_widget.js', + 'show_booking_management/static/src/xml/**/*.xml', + ], + 'web.assets_frontend': [ + 'show_booking_management/static/src/js/bookShow.js', + 'show_booking_management/static/src/js/selectSeat.js', + 'show_booking_management/static/src/css/show_booking_management.css', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/show_booking_management/controller/__init__.py b/show_booking_management/controller/__init__.py new file mode 100644 index 000000000..13c64eefe --- /dev/null +++ b/show_booking_management/controller/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 payment +from . import portal +from . import show_booking_management diff --git a/show_booking_management/controller/payment.py b/show_booking_management/controller/payment.py new file mode 100644 index 000000000..6f903a471 --- /dev/null +++ b/show_booking_management/controller/payment.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +import base64 +import json +from io import BytesIO +import qrcode +from odoo import http +from odoo.http import request +from odoo.addons.payment.controllers.post_processing import PaymentPostProcessing + + +class PaymentPost(PaymentPostProcessing): + """ + Inherit the poll status method to handle payment status completion. + Creates movie registration and movie seats records if payment status is 'done'. + """ + @http.route() + def poll_status(self, **kwargs): + """ Inheriting the poll status and if the status of payment is done + it will create records movie registration and movie seats.""" + res = super(PaymentPost, self).poll_status(**kwargs) + movie_booking_data = request.session.get('movie_booking_data') + if movie_booking_data and res['state'] == 'done': + movie_booking_data = json.loads(movie_booking_data) + # Creating movie.registration record + movie_ticket = request.env['movie.registration'].create({ + 'movie_id': movie_booking_data['movie_id'], + 'screen_id': movie_booking_data['screen_id'], + 'time_slot_id': movie_booking_data['time_slot_id'], + 'date': movie_booking_data['booking_date'], + 'no_of_tickets': len(movie_booking_data['selected_seats']), + 'partner_id': request.env.user.partner_id.id, + 'state': 'invoiced' + }) + # Creating QR code + qr_data = f"Ticket : {movie_ticket.name}\n" \ + f"Movie: {movie_ticket.movie_id.name}\n" \ + f"Date: {movie_ticket.date}\n" \ + f"Time: {movie_ticket.time_slot_id.name}\n" \ + f"Screen: {movie_ticket.screen_id.name}\n" \ + f"Seats: {', '.join(movie_booking_data['selected_seats'])}" + qr = qrcode.QRCode(version=1, box_size=10, border=5) + qr.add_data(qr_data) + qr.make(fit=True) + img = qr.make_image() + buffer = BytesIO() + img.save(buffer, format="PNG") + qr_image = base64.b64encode(buffer.getvalue()).decode() + movie_ticket.write({'qr_code': qr_image}) + + # Creating movie.seats records + for seat in movie_booking_data['selected_seats']: + request.env['movie.seats'].create({ + 'screen_id': movie_booking_data['screen_id'], + 'time_slot_id': movie_booking_data['time_slot_id'], + 'movie_registration_id': movie_ticket.id, + 'date': movie_booking_data['booking_date'], + 'seat': seat, + 'is_booked': True + }) + invoice = request.env['account.move'].browse( + movie_booking_data['invoice_id']) + invoice.movie_ticket_id = movie_ticket.id + movie_admin_users = request.env['res.users'].search([ + ('groups_id', 'in', + request.env.ref('show_booking_management.show_booking_management_group_admin').id) + ]) + template = request.env.ref( + 'show_booking_management.email_template_movie_ticket') + attachment_id = request.env['ir.attachment'].create({ + 'name': 'Movie_Ticket_QR_Code.png', + 'type': 'binary', + 'datas': qr_image, + 'res_model': 'movie.registration', + 'res_id': movie_ticket.id, + 'mimetype': 'image/png' + }) + email_values = { + 'email_from': movie_admin_users[0].email, + 'attachment_ids': [(6, 0, [attachment_id.id])], + } + template.send_mail(movie_ticket.id, email_values=email_values, force_send=True) + return res diff --git a/show_booking_management/controller/portal.py b/show_booking_management/controller/portal.py new file mode 100644 index 000000000..5f9af2308 --- /dev/null +++ b/show_booking_management/controller/portal.py @@ -0,0 +1,33 @@ +from odoo import http +from odoo.http import request +from odoo.addons.portal.controllers.portal import CustomerPortal + + +class ShowPortal(CustomerPortal): + """ Prepare values for the home portal and retrieve shows based on user permissions.""" + def _prepare_home_portal_values(self, counters): + """ + Prepare values for the home portal and retrieve the count + of shows available based on user permissions. + """ + values = super()._prepare_home_portal_values(counters) + if 'shows_count' in counters: + shows_count = request.env['movie.registration'].search_count([]) + + values['shows_count'] = shows_count + return values + + @http.route('/my/shows', type='http', auth="user", website=True) + def my_subscription(self, **kw): + """ + Retrieve shows for the user based on permissions and render them on the portal. + """ + user = request.env.user + if user.has_group('base.group_system'): + shows = request.env['movie.registration'].sudo().search([]) + else: + shows = request.env['movie.registration'].sudo().search([('partner_id', '=', user.partner_id.id)]) + values = { + 'shows': shows, + } + return request.render('show_booking_management.portal_my_shows', values) diff --git a/show_booking_management/controller/show_booking_management.py b/show_booking_management/controller/show_booking_management.py new file mode 100644 index 000000000..4d4cf6b74 --- /dev/null +++ b/show_booking_management/controller/show_booking_management.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +import json +from werkzeug.urls import url_encode +from odoo import http, fields +from odoo.http import request + + +class MovieShow(http.Controller): + """ This class defines the HTTP routes and movie shows. + It provides functionality to render the movie template for user + interaction.""" + @http.route(['/show'], type='http', auth="public", csrf=False, website=True) + def show_movies(self): + """ Function for rendering show page.""" + movies = request.env['movie.movie'].search([('state', '=', 'ongoing')]) + return http.request.render('show_booking_management.show_movie', + {'movies': movies}) + + @http.route(['/book_now/'], type='http', auth="public", + csrf=False, website=True) + def book_now(self, movie_id): + """ Function for rendering booking page while clicking the button book now.""" + movie = request.env['movie.movie'].browse(movie_id) + return http.request.render('show_booking_management.book_movie', + {'movie': movie}) + + @http.route('/movie/book_ticket', type='http', auth='public', website=True, + methods=['POST'], csrf=False) + def book_ticket(self, **kwargs): + """ Function for submitting the form and rendering the seat selection chart.""" + movie_id = request.env['movie.movie'].browse( + int(kwargs.get('movie_id'))) + screen_id = request.env['movie.screen'].browse( + int(kwargs.get('screen'))) + time_slot_id = request.env['time.slots'].browse( + int(kwargs.get('time_slots'))) + booked_seats = request.env['movie.seats'].search([ + ('screen_id', '=', screen_id.id), + ('time_slot_id', '=', int(kwargs.get('time_slots'))), + ('date', '=', kwargs.get('show_date')), + ('is_booked', '=', True) + ]).mapped('seat') + + return http.request.render( + 'show_booking_management.seat_selection_template', + {'screen': screen_id, 'movie': movie_id, + 'time_slot_id': time_slot_id, 'booked_seats': booked_seats, + 'booked_seats_count': len(booked_seats), + 'available_seats_count': screen_id.total_seat_count - len(booked_seats), + 'booking_date': kwargs.get('show_date')}) + + @http.route('/movie/confirm_booking', type='http', auth='public', + website=True, methods=['POST'], csrf=True) + def confirm_booking(self, **post): + """ Function for confirming the seats selection and creating invoice.""" + selected_seats = request.httprequest.form.getlist('selected_seats') + movie = request.env['movie.movie'].browse(int(post.get('movie_id'))) + product = request.env.ref('show_booking_management.product_1') + invoice = request.env['account.move'].sudo().create({ + 'move_type': 'out_invoice', + 'invoice_origin': 'Movie', + 'partner_id': request.env.user.partner_id.id, + 'invoice_date': fields.Date.today(), + 'state': 'draft', + 'invoice_line_ids': [(0, 0, { + 'name': f"Ticket for {movie.name} on {post.get('booking_date')}", + 'product_id': product.id, + 'quantity': len(selected_seats), + 'price_unit': movie.price, + })], + }) + if invoice: + invoice.sudo().action_post() + access_token = invoice._portal_ensure_token() + booking_data = { + 'invoice_id': invoice.id, + 'movie_id': int(post.get('movie_id')), + 'screen_id': int(post.get('screen_id')), + 'time_slot_id': int(post.get('time_slot_id')), + 'booking_date': post.get('booking_date'), + 'selected_seats': selected_seats, + } + request.session['movie_booking_data'] = json.dumps(booking_data) + params = { + 'access_token': access_token, + 'payment_method_id': post.get('payment_method_id'), + } + return request.redirect(f'/my/invoices/{invoice.id}?{url_encode(params)}') diff --git a/show_booking_management/data/ir_sequence_data.xml b/show_booking_management/data/ir_sequence_data.xml new file mode 100644 index 000000000..9e5012187 --- /dev/null +++ b/show_booking_management/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + Movie Registration + movie.registration + MV + 5 + 1 + 1 + + + + diff --git a/show_booking_management/data/mail_template_data.xml b/show_booking_management/data/mail_template_data.xml new file mode 100644 index 000000000..7248f5f00 --- /dev/null +++ b/show_booking_management/data/mail_template_data.xml @@ -0,0 +1,61 @@ + + + + + + Movie Ticket Booking Confirmation + + Movie Ticket : {{object.movie_id.name}} On {{object.date}} + {{object.partner_id.email}} + +

Your movie ticket booking for + + + + has been confirmed. +

+

Movie Ticket Details:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Movie + +
Screen + +
Time Slot + +
Date + +
Number of Tickets + +
Seats + +
+

Thank you for booking with us.

+
+
+
+
diff --git a/show_booking_management/data/product_product_data.xml b/show_booking_management/data/product_product_data.xml new file mode 100644 index 000000000..728d05be9 --- /dev/null +++ b/show_booking_management/data/product_product_data.xml @@ -0,0 +1,10 @@ + + + + + + Movie Ticket + service + + + diff --git a/show_booking_management/data/report_paperformat_data.xml b/show_booking_management/data/report_paperformat_data.xml new file mode 100644 index 000000000..2d91357df --- /dev/null +++ b/show_booking_management/data/report_paperformat_data.xml @@ -0,0 +1,17 @@ + + + + + Movie Ticket Receipt + + custom + 200 + 80 + Portrait + 10 + 10 + 10 + 10 + + + diff --git a/show_booking_management/data/website_menu_data.xml b/show_booking_management/data/website_menu_data.xml new file mode 100644 index 000000000..f35854520 --- /dev/null +++ b/show_booking_management/data/website_menu_data.xml @@ -0,0 +1,12 @@ + + + + + + Show + /show + + 50 + + + diff --git a/show_booking_management/doc/RELEASE_NOTES.md b/show_booking_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..c8675b091 --- /dev/null +++ b/show_booking_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 06.09.2024 +#### Version 17.0.1.0.0 +##### ADD +-Initial Commit for Show Booking Management diff --git a/show_booking_management/models/__init__.py b/show_booking_management/models/__init__.py new file mode 100644 index 000000000..466a06629 --- /dev/null +++ b/show_booking_management/models/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 account_move +from . import cast_type +from . import movie_cast +from . import movie_movie +from . import movie_registration +from . import movie_screen +from . import movie_seats +from . import show_type +from . import time_slots diff --git a/show_booking_management/models/account_move.py b/show_booking_management/models/account_move.py new file mode 100644 index 000000000..b2dc1049e --- /dev/null +++ b/show_booking_management/models/account_move.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 AccountMove(models.Model): + """ + Add a Many2one field to link movie tickets with account moves. + """ + _inherit = 'account.move' + + movie_ticket_id = fields.Many2one('account.move', + string='Movie Ticket ID', + help='Movie ticket ID') diff --git a/show_booking_management/models/cast_type.py b/show_booking_management/models/cast_type.py new file mode 100644 index 000000000..0119fc80c --- /dev/null +++ b/show_booking_management/models/cast_type.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 CastType(models.Model): + """ + Defines a model for Cast Type. + """ + _name = 'cast.type' + _description = 'Cast Type' + + name = fields.Char(string='Cast Type', help='Mention the Cast type') diff --git a/show_booking_management/models/movie_cast.py b/show_booking_management/models/movie_cast.py new file mode 100644 index 000000000..6a683eaf2 --- /dev/null +++ b/show_booking_management/models/movie_cast.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 MovieCast(models.Model): + """ + Movie Cast model for managing information about movie casts. + """ + _name = 'movie.cast' + _description = 'Movie Cast' + + name = fields.Char(string='Name', help='Name of the movie cast') + cast_id = fields.Many2one('cast.type', string='Cast Type', help='Id of the cast type') + cast_image = fields.Binary(String='Image', help='Image of the movie cast') diff --git a/show_booking_management/models/movie_movie.py b/show_booking_management/models/movie_movie.py new file mode 100644 index 000000000..3caaf5049 --- /dev/null +++ b/show_booking_management/models/movie_movie.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 api, fields, models +from odoo.exceptions import ValidationError + + +class MovieMovie(models.Model): + """ + Model for managing movie details including name, duration, + release date, show type, language, poster, time slots, cast, + screens, price, overview, currency, and status. + """ + _name = 'movie.movie' + _description = 'Movie Movie' + + name = fields.Char(string='Name', help='Name of the Movie') + duration = fields.Float(string='Duration of the movie', + help='Duration of the Movie') + release_date = fields.Date(string='Release Date', + help='Release date of the Movie') + show_type_ids = fields.Many2many('show.type', + string='Show Type', + help='Show type of the movie') + movie_language_id = fields.Many2one('res.lang', + string='Movie Language', + help='Language of the movie') + movie_poster = fields.Binary(string='Movie Poster', help='Poster of the Movie') + available_time_slots_ids = fields.Many2many('time.slots', + string='Time Slots', + help='Time slots of the movie') + movie_cast_ids = fields.Many2many('movie.cast', + string='Movie Cast', + help='Mention the movie casts') + available_screens_ids = fields.Many2many('movie.screen', + string='Screens', + help='Mention the screens') + show_start_date = fields.Date(string='Show Start Date', + help='Mention the show start date') + show_end_date = fields.Date(string='Show End Date', + help='Mention the show end date') + price = fields.Monetary(currency_field='currency_id', string='Price', + help='Mention the ticket price') + about_movie = fields.Text(string='About Movie', help='Overview of the movie.') + currency_id = fields.Many2one('res.currency', + string='Currency', + help="Currency", + required=True, + default=lambda + self: self.env.user.company_id.currency_id) + state = fields.Selection([('draft', 'Draft'), + ('ongoing', 'Ongoing'), + ('cancel', 'Cancelled')], + string='Status', default='draft', + help='') + + @api.constrains('show_start_date', 'show_end_date', 'release_date') + def _check_show_start_date(self): + """ Function for validating show start date and end date """ + for record in self: + if (record.show_start_date and record.release_date and + record.show_start_date < record.release_date): + raise ValidationError( + 'Show Start date must be on or after the Release Date') + if (record.show_end_date and record.show_end_date and + record.show_start_date > record.show_end_date): + raise ValidationError( + 'Show End date must be on or after the Show Start date') + + @api.constrains('available_screens_ids', 'show_start_date', 'show_end_date') + def _check_screen_availability(self): + """ Function for checking the screen availability if the + screen is already booked for another movie it raises error""" + for record in self: + if record.show_start_date and record.show_end_date: + overlapping_movies = self.env['movie.movie'].search([ + ('id', '!=', record.id), + ('available_screens_ids', 'in', + record.available_screens_ids.ids), + ('show_start_date', '<=', record.show_end_date), + ('show_end_date', '>=', record.show_start_date), + ]) + if overlapping_movies: + raise ValidationError( + 'One or more of the selected screens are already booked ' + 'for another movie during this period.') + + @api.model + def create(self, vals): + """Supering create function to check screen availability""" + res = super(MovieMovie, self).create(vals) + res._check_screen_availability() + return res + + @api.model + def write(self, vals): + """Supering create function to check screen availability""" + res = super(MovieMovie, self).write(vals) + self._check_screen_availability() + return res + + @api.model + def check_shows_on_date(self, date, selected_movie): + """ Function for searching the movies based on the date from js.""" + movie = self.search([('id', '=', selected_movie), + ('show_start_date', '<=', date), + ('show_end_date', '>=', date)]) + return bool(movie) + + def action_start_show(self): + """ Function for changing the state into ongoing.""" + for rec in self: + if fields.Date.today() >= rec.show_start_date: + self.write({'state': 'ongoing'}) + else: + raise ValidationError( + 'Show Starts only based on the Show Start Date') + + def action_cancel_show(self): + """ Function for changing the state into cancel.""" + self.write({'state': 'cancel'}) + + @api.model + def update_seats(self, screen_id, time_slot_id, booking_date): + """ + Update the seats availability based on the screen, time slot, and booking date. + """ + booked_seats = self.env['movie.seats'].search([ + ('screen_id', '=', int(screen_id)), + ('time_slot_id', '=', int(time_slot_id)), + ('date', '=', booking_date), + ('is_booked', '=', True) + ]).mapped('seat') + time_slot = self.env['time.slots'].browse(int(time_slot_id)).name + screen = self.env['movie.screen'].browse(int(screen_id)) + return {'booked_seats': booked_seats, + 'time_slot': time_slot, + 'booked_seats_count': len(booked_seats), + 'available_seats_count': screen.total_seat_count - len(booked_seats)} diff --git a/show_booking_management/models/movie_registration.py b/show_booking_management/models/movie_registration.py new file mode 100644 index 000000000..6314d0a82 --- /dev/null +++ b/show_booking_management/models/movie_registration.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 api, fields, models +from odoo.exceptions import ValidationError + + +class MovieRegistration(models.Model): + """ + Model for managing movie registrations including details like partner, + movie, date, time slot, screen, tickets, etc. + """ + _name = 'movie.registration' + _description = 'Movie Registration' + + name = fields.Char(required=True, copy=False, + default='New', readonly=True, + help='Name of the Movie Ticket') + partner_id = fields.Many2one('res.partner', string='Select Partner', + help='Mention the partner') + movie_id = fields.Many2one('movie.movie', string='Select Movie', + domain="[('id', 'in', available_movie_ids)]", + required=True, help='Mention the movie id') + movie_type = fields.Many2many('show.type', related='movie_id.show_type_ids', + help='Show type of the movie') + movie_lang = fields.Many2one('res.lang', string='Movie Langauge', + related='movie_id.movie_language_id', + help='Language of the movie') + date = fields.Date(string='Date', default=fields.Date.today(), + required=True, help='Mention the date for booking.') + time_slot_id = fields.Many2one('time.slots', + string='Select time slot', + domain="[('id', 'in', available_time_slot_ids)]", + required=True, help='Mention the time slots of the movie') + screen_id = fields.Many2one('movie.screen', string='Select Screen', + domain="[('id', 'in', available_screens_ids)]", + required=True, help='Mention the screen of the movie') + available_movie_ids = fields.Many2many('movie.movie', + string='Available movies', + help='Mention the available movies') + available_time_slot_ids = fields.Many2many('time.slots', + string='Available time slots', + compute='_compute_available_time_slot_ids', + help='Mention the available time slots') + available_screens_ids = fields.Many2many('movie.screen', + string='Available screens', + help='Mention the available screen') + movie_price = fields.Monetary(string='Movie Price', + related='movie_id.price', + help='Price of the movie ticket') + currency_id = fields.Many2one('res.currency', string='Currency', + help="Currency", + required=True, + default=lambda + self: self.env.user.company_id.currency_id) + no_of_tickets = fields.Integer(string='Number of tickets', default=1, + help='Mention the number of tickets') + movie_poster = fields.Binary(related='movie_id.movie_poster', + string='Movie poster', + help='Poster of the movie.') + movie_cast_ids = fields.Many2many(related='movie_id.movie_cast_ids', + string='Movie Cast', readonly=True, + help='Movie casts') + seat_ids = fields.One2many('movie.seats', 'movie_registration_id', + string="Seats", help='Mention the seat ids') + qr_code = fields.Binary(string='Qr Code', help='Qr code containing ticket details') + state = fields.Selection([('draft', 'Draft'), + ('done', 'Done'), + ('invoiced', 'Invoiced')], string='Status', + default='draft', help='Status of the movie registration') + + def action_submit(self): + """ Function for writing the state into done.""" + self.write({'state': 'done'}) + + def action_invoice(self): + """ Function for creating invoice.""" + product_id = self.env.ref('show_booking_management.product_1') + try: + move = self.env['account.move'].create([ + { + 'move_type': 'out_invoice', + 'partner_id': self.partner_id.id, + 'movie_ticket_id': self.id, + 'date': self.date, + 'invoice_date': fields.Date.today(), + 'invoice_line_ids': [ + (0, 0, + { + 'product_id': product_id.id, + 'name': product_id.name, + 'quantity': self.no_of_tickets, + 'price_unit': self.movie_id.price, + })], + }, ]) + self.write({'state': 'invoiced'}) + move.action_post() + return { + 'name': 'Invoice', + 'res_id': move.id, + 'res_model': 'account.move', + 'view_id': False, + 'view_mode': 'form', + 'type': 'ir.actions.act_window', + } + except: + raise ValidationError('Invoice Creation Failed!') + + @api.depends('movie_id') + def _compute_available_time_slot_ids(self): + """ Function for computing time slots and screens.""" + for record in self: + record.available_time_slot_ids = record.movie_id.available_time_slots_ids.ids + record.available_screens_ids = record.movie_id.available_screens_ids.ids + + @api.onchange('date') + def fetch_movies(self): + """ Function for validating date and fetching movies based on the date.""" + for record in self: + if record.date < fields.Date.today(): + raise ValidationError('The date must be greater than or equal to today\'s date.') + record.movie_id = None + record.available_movie_ids = None + movies_list = self.env['movie.movie'].search([ + ('show_start_date', '<=', record.date), + ('show_end_date', '>=', record.date), + ]).ids + record.available_movie_ids = movies_list + + def check_seat_availability(self): + """ Function for checking seat availability""" + reserved_seats = sum(self.search([ + ('date', '=', self.date), + ('time_slot_id', '=', self.time_slot_id.id), + ('screen_id', '=', self.screen_id.id), + ('state', '=', 'invoiced') + ]).mapped('no_of_tickets')) + self.no_of_tickets + if reserved_seats > self.screen_id.total_seat_count: + raise ValidationError('Selected screen is already full') + + @api.model + def create(self, vals): + """Supering create function to check screen availability""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'movie.registration') + res = super(MovieRegistration, self).create(vals) + res.check_seat_availability() + return res + + @api.constrains('no_of_tickets') + def check_seat(self): + """ Function for checking seat availability based on the number of tickets""" + self.check_seat_availability() + + @api.onchange('movie_id') + def set_values(self): + """ Function for resetting time slot and screen while changing movie.""" + for record in self: + record.update({'time_slot_id': None, 'screen_id': None}) + + def action_generate_ticket_pdf(self): + """ Function for downloading ticket pdf.""" + return self.env.ref( + 'show_booking_management.action_report_movie_ticket').report_action(self) + + @api.model + def check_seat_available(self, date, time_slot_id, screen_id, ticket_count): + """ Function for updating the status of the seats availability based + on the movie time slot and screen selected""" + screen = self.env['movie.screen'].browse(int(screen_id)) + reserved_seats = sum(self.search([ + ('date', '=', date), + ('time_slot_id', '=', int(time_slot_id)), + ('screen_id', '=', int(screen_id)), + ('state', '=', 'invoiced') + ]).mapped('no_of_tickets')) + if reserved_seats + int(ticket_count) > screen.total_seat_count: + return { + 'Status': 'Failed', + 'Error': f"The selected screen has only " + f"{screen.total_seat_count - reserved_seats} seats left!" + } + return {'Status': 'Success'} + + def action_open_invoices(self): + """ Function for viewing created invoices""" + return { + 'name': 'Invoice', + 'domain': [('movie_ticket_id', '=', self.id)], + 'res_model': 'account.move', + 'view_id': False, + 'view_mode': 'tree,form', + 'type': 'ir.actions.act_window', + } diff --git a/show_booking_management/models/movie_screen.py b/show_booking_management/models/movie_screen.py new file mode 100644 index 000000000..9954f21c0 --- /dev/null +++ b/show_booking_management/models/movie_screen.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 api, fields, models + + +class MovieScreen(models.Model): + """ + Model for managing movie screens with details like name, total rows, + seats per row, and total seat count. + """ + _name = 'movie.screen' + _description = 'Movie Screen' + + name = fields.Char(string='Name of the screen', + help='Mention the name of the screen') + total_rows = fields.Integer(string='Number of total Rows', + help='Mention the number of total rows.') + no_of_seat_row = fields.Integer(string='Number of seat per row', + help='Mention the number of seats per row') + total_seat_count = fields.Integer(string='Total seats', + compute='_compute_total_seat_count', + help='Calculates the total seats') + + @api.constrains('total_rows', 'no_of_seat_row') + def _compute_total_seat_count(self): + """ Function for computing total seats in the screen.""" + for record in self: + if record.total_rows and record.no_of_seat_row: + record.total_seat_count = record.total_rows * record.no_of_seat_row + else: + record.total_seat_count = 0 diff --git a/show_booking_management/models/movie_seats.py b/show_booking_management/models/movie_seats.py new file mode 100644 index 000000000..6632b68cb --- /dev/null +++ b/show_booking_management/models/movie_seats.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 MovieSeats(models.Model): + """ + Movie Seats model for managing seat bookings. + """ + _name = 'movie.seats' + _description = 'Movie Seats' + + screen_id = fields.Many2one('movie.screen', 'Screen', + required=True, help='Mention the screen id') + time_slot_id = fields.Many2one('time.slots', 'Time Slot', + required=True, help='Mention the time slot id') + movie_registration_id = fields.Many2one('movie.registration', + 'Booking ID', required=True, + help='Mention the movie registration id') + date = fields.Date(string='Date', help='Mention the date', required=True) + seat = fields.Char(string='Seat', required=True, help='Mention the seats') + is_booked = fields.Boolean('Is booked', help='Check if is booked true') diff --git a/show_booking_management/models/show_type.py b/show_booking_management/models/show_type.py new file mode 100644 index 000000000..576f70c33 --- /dev/null +++ b/show_booking_management/models/show_type.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 ShowType(models.Model): + """ + Show Type model for managing different types of shows. + """ + _name = 'show.type' + _description = 'Show Type' + + name = fields.Char(string='Show Type', + required=True, + help='Name of the Show type') diff --git a/show_booking_management/models/time_slots.py b/show_booking_management/models/time_slots.py new file mode 100644 index 000000000..203055f2e --- /dev/null +++ b/show_booking_management/models/time_slots.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 datetime import datetime +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class TimeSlots(models.Model): + """ + Time slots model for managing different time slots for show. + """ + _name = 'time.slots' + _description = 'Time Slots' + + name = fields.Char(string='Time Slot', default='New', + readonly=True, help='Mention the name of the Time slots') + movie_time = fields.Char(string='Movie Time', help='Mention the slot time') + + _sql_constraints = [ + ('name_uniq', 'unique(name)', "Name should be unique") + ] + + @api.model + def create(self, vals): + """Supering create function to update name.""" + if vals['movie_time']: + vals['name'] = datetime.strptime(vals['movie_time'], "%H:%M").strftime("%I:%M %p") + vals['movie_time'] = vals['movie_time'].replace(":", ".") + else: + raise ValidationError('Please mention time!!') + return super().create(vals) + + @api.model + def write(self, vals): + """Supering write function to update name.""" + if vals['movie_time']: + vals['name'] = datetime.strptime(vals['movie_time'], + "%H:%M").strftime("%I:%M %p") + vals['movie_time'] = vals['movie_time'].replace(":", ".") + res = super(TimeSlots, self).write(vals) + return res diff --git a/show_booking_management/report/movie_registration_templates.xml b/show_booking_management/report/movie_registration_templates.xml new file mode 100644 index 000000000..68951a474 --- /dev/null +++ b/show_booking_management/report/movie_registration_templates.xml @@ -0,0 +1,77 @@ + + + + + + + Movie Ticket + movie.registration + qweb-pdf + show_booking_management.report_movie_ticket + show_booking_management.report_movie_ticket + + + + diff --git a/show_booking_management/security/ir.model.access.csv b/show_booking_management/security/ir.model.access.csv new file mode 100644 index 000000000..9a8344df3 --- /dev/null +++ b/show_booking_management/security/ir.model.access.csv @@ -0,0 +1,9 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_movie_movie,access.movie.movie,model_movie_movie,base.group_user,1,1,1,1 +access_show_type,access.show.type,model_show_type,base.group_user,1,1,1,1 +access_cast_type,access.cast.type,model_cast_type,base.group_user,1,1,1,1 +access_movie_cast,access.movie.cast,model_movie_cast,base.group_user,1,1,1,1 +access_time_slots,access.time.slots,model_time_slots,base.group_user,1,1,1,1 +access_movie_screen,access.movie.screen,model_movie_screen,base.group_user,1,1,1,1 +access_movie_seats,access.movie.seats,model_movie_seats,base.group_user,1,1,1,1 +access_movie_registration,access.movie.registration,model_movie_registration,base.group_user,1,1,1,1 diff --git a/show_booking_management/security/show_booking_management_groups.xml b/show_booking_management/security/show_booking_management_groups.xml new file mode 100644 index 000000000..577da5a18 --- /dev/null +++ b/show_booking_management/security/show_booking_management_groups.xml @@ -0,0 +1,8 @@ + + + + + Show Booking Management Admin + + + diff --git a/show_booking_management/static/description/assets/cybro-icon.png b/show_booking_management/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/show_booking_management/static/description/assets/cybro-icon.png differ diff --git a/show_booking_management/static/description/assets/cybro-odoo.png b/show_booking_management/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/show_booking_management/static/description/assets/cybro-odoo.png differ diff --git a/show_booking_management/static/description/assets/h2.png b/show_booking_management/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/show_booking_management/static/description/assets/h2.png differ diff --git a/show_booking_management/static/description/assets/icons/check.png b/show_booking_management/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/show_booking_management/static/description/assets/icons/check.png differ diff --git a/show_booking_management/static/description/assets/icons/chevron.png b/show_booking_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/chevron.png differ diff --git a/show_booking_management/static/description/assets/icons/cogs.png b/show_booking_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/cogs.png differ diff --git a/show_booking_management/static/description/assets/icons/consultation.png b/show_booking_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/show_booking_management/static/description/assets/icons/consultation.png differ diff --git a/show_booking_management/static/description/assets/icons/down.svg b/show_booking_management/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/show_booking_management/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/show_booking_management/static/description/assets/icons/ecom-black.png b/show_booking_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/ecom-black.png differ diff --git a/show_booking_management/static/description/assets/icons/education-black.png b/show_booking_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/show_booking_management/static/description/assets/icons/education-black.png differ diff --git a/show_booking_management/static/description/assets/icons/faq.png b/show_booking_management/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/faq.png differ diff --git a/show_booking_management/static/description/assets/icons/feature.png b/show_booking_management/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/feature.png differ diff --git a/show_booking_management/static/description/assets/icons/hotel-black.png b/show_booking_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/show_booking_management/static/description/assets/icons/hotel-black.png differ diff --git a/show_booking_management/static/description/assets/icons/license.png b/show_booking_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/show_booking_management/static/description/assets/icons/license.png differ diff --git a/show_booking_management/static/description/assets/icons/lifebuoy.png b/show_booking_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/show_booking_management/static/description/assets/icons/lifebuoy.png differ diff --git a/show_booking_management/static/description/assets/icons/manufacturing-black.png b/show_booking_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/show_booking_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/show_booking_management/static/description/assets/icons/notes.png b/show_booking_management/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/notes.png differ diff --git a/show_booking_management/static/description/assets/icons/pos-black.png b/show_booking_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/pos-black.png differ diff --git a/show_booking_management/static/description/assets/icons/puzzle.png b/show_booking_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/puzzle.png differ diff --git a/show_booking_management/static/description/assets/icons/restaurant-black.png b/show_booking_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/restaurant-black.png differ diff --git a/show_booking_management/static/description/assets/icons/screenshot.png b/show_booking_management/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/screenshot.png differ diff --git a/show_booking_management/static/description/assets/icons/service-black.png b/show_booking_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/show_booking_management/static/description/assets/icons/service-black.png differ diff --git a/show_booking_management/static/description/assets/icons/skype.png b/show_booking_management/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/skype.png differ diff --git a/show_booking_management/static/description/assets/icons/star-1.svg b/show_booking_management/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/show_booking_management/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/show_booking_management/static/description/assets/icons/star-2.svg b/show_booking_management/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/show_booking_management/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/show_booking_management/static/description/assets/icons/support.png b/show_booking_management/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/support.png differ diff --git a/show_booking_management/static/description/assets/icons/test-1 - Copy.png b/show_booking_management/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/test-1 - Copy.png differ diff --git a/show_booking_management/static/description/assets/icons/test-1.png b/show_booking_management/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/show_booking_management/static/description/assets/icons/test-1.png differ diff --git a/show_booking_management/static/description/assets/icons/test-2.png b/show_booking_management/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/show_booking_management/static/description/assets/icons/test-2.png differ diff --git a/show_booking_management/static/description/assets/icons/trading-black.png b/show_booking_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/trading-black.png differ diff --git a/show_booking_management/static/description/assets/icons/training.png b/show_booking_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/show_booking_management/static/description/assets/icons/training.png differ diff --git a/show_booking_management/static/description/assets/icons/update.png b/show_booking_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/show_booking_management/static/description/assets/icons/update.png differ diff --git a/show_booking_management/static/description/assets/icons/user.png b/show_booking_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/show_booking_management/static/description/assets/icons/user.png differ diff --git a/show_booking_management/static/description/assets/icons/video.png b/show_booking_management/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/video.png differ diff --git a/show_booking_management/static/description/assets/icons/whatsapp.png b/show_booking_management/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/show_booking_management/static/description/assets/icons/whatsapp.png differ diff --git a/show_booking_management/static/description/assets/icons/wrench.png b/show_booking_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/show_booking_management/static/description/assets/icons/wrench.png differ diff --git a/show_booking_management/static/description/assets/modules/1.gif b/show_booking_management/static/description/assets/modules/1.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/show_booking_management/static/description/assets/modules/1.gif differ diff --git a/show_booking_management/static/description/assets/modules/2.jpg b/show_booking_management/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..a1dc39c89 Binary files /dev/null and b/show_booking_management/static/description/assets/modules/2.jpg differ diff --git a/show_booking_management/static/description/assets/modules/3.png b/show_booking_management/static/description/assets/modules/3.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/show_booking_management/static/description/assets/modules/3.png differ diff --git a/show_booking_management/static/description/assets/modules/4.png b/show_booking_management/static/description/assets/modules/4.png new file mode 100644 index 000000000..3bedf7981 Binary files /dev/null and b/show_booking_management/static/description/assets/modules/4.png differ diff --git a/show_booking_management/static/description/assets/modules/5.png b/show_booking_management/static/description/assets/modules/5.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/show_booking_management/static/description/assets/modules/5.png differ diff --git a/show_booking_management/static/description/assets/modules/6.jpg b/show_booking_management/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/show_booking_management/static/description/assets/modules/6.jpg differ diff --git a/show_booking_management/static/description/assets/screenshots/1.png b/show_booking_management/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..4db2542c4 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/1.png differ diff --git a/show_booking_management/static/description/assets/screenshots/10.png b/show_booking_management/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..2e87e58d5 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/10.png differ diff --git a/show_booking_management/static/description/assets/screenshots/11.png b/show_booking_management/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..5c38e13db Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/11.png differ diff --git a/show_booking_management/static/description/assets/screenshots/12.png b/show_booking_management/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..06e1d1b81 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/12.png differ diff --git a/show_booking_management/static/description/assets/screenshots/13.png b/show_booking_management/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..8a6c7083f Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/13.png differ diff --git a/show_booking_management/static/description/assets/screenshots/14.png b/show_booking_management/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..a39e35114 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/14.png differ diff --git a/show_booking_management/static/description/assets/screenshots/15.png b/show_booking_management/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..96af6bb0d Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/15.png differ diff --git a/show_booking_management/static/description/assets/screenshots/16.png b/show_booking_management/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..e3e8e1994 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/16.png differ diff --git a/show_booking_management/static/description/assets/screenshots/17.png b/show_booking_management/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..62993381d Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/17.png differ diff --git a/show_booking_management/static/description/assets/screenshots/18.png b/show_booking_management/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..b8033a10e Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/18.png differ diff --git a/show_booking_management/static/description/assets/screenshots/2.png b/show_booking_management/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..d59cef229 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/2.png differ diff --git a/show_booking_management/static/description/assets/screenshots/3.png b/show_booking_management/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..893f6ae21 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/3.png differ diff --git a/show_booking_management/static/description/assets/screenshots/4.png b/show_booking_management/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..382902533 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/4.png differ diff --git a/show_booking_management/static/description/assets/screenshots/5.png b/show_booking_management/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..5ee07b0ef Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/5.png differ diff --git a/show_booking_management/static/description/assets/screenshots/6.png b/show_booking_management/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..b20862c55 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/6.png differ diff --git a/show_booking_management/static/description/assets/screenshots/7.png b/show_booking_management/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..97718837b Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/7.png differ diff --git a/show_booking_management/static/description/assets/screenshots/8.png b/show_booking_management/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..70f75bbf5 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/8.png differ diff --git a/show_booking_management/static/description/assets/screenshots/9.png b/show_booking_management/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..c279c4176 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/9.png differ diff --git a/show_booking_management/static/description/assets/screenshots/hero.gif b/show_booking_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d78a46479 Binary files /dev/null and b/show_booking_management/static/description/assets/screenshots/hero.gif differ diff --git a/show_booking_management/static/description/assets/y18.jpg b/show_booking_management/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/show_booking_management/static/description/assets/y18.jpg differ diff --git a/show_booking_management/static/description/banner.jpg b/show_booking_management/static/description/banner.jpg new file mode 100644 index 000000000..56120b0c4 Binary files /dev/null and b/show_booking_management/static/description/banner.jpg differ diff --git a/show_booking_management/static/description/icon.png b/show_booking_management/static/description/icon.png new file mode 100644 index 000000000..92970aa44 Binary files /dev/null and b/show_booking_management/static/description/icon.png differ diff --git a/show_booking_management/static/description/index.html b/show_booking_management/static/description/index.html new file mode 100644 index 000000000..d8e910ebd --- /dev/null +++ b/show_booking_management/static/description/index.html @@ -0,0 +1,1186 @@ + + + + + + + + + Document + + + + + + + + +
+ +
+
+

+ Show Booking Management +

+

+ This Module Helps To Manage Shows And Book Shows Easily

+
+
+

+ Easily manage and book shows through the website by specifying + the date, screen, time slot, and available seats. +

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

+ KEY HIGHLIGHTS +

+
+
+
+
+ +
+
+

+ Manage Shows

+

+ Admin can manage shows easily.

+
+
+
+
+
+
+ +
+
+

+ User Friendly

+

+ Users can select seats based on their preferences.

+
+
+
+
+
+
+ +
+
+

+ Seat Confirmation

+

+ Users can confirm their seats by making a payment. +

+
+
+
+
+
+
+ +
+
+

+ Notification

+

+ Notify the user about a successful show booking via email. +

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

+ Overview + + +

+

+ Show Booking Management.

+
+ +
+
+ This module facilitates efficient show booking management. + Administrators can manage shows details, including scheduling, screen allocation. + Users can easily book shows through the website by selecting the desired date, + screen, time slot, and preferred seats. The system allows for seamless seat + selection and booking confirmation, ensuring a smooth user experience. +
+
+ +
+
+ + +
+ + + +
+
+ +
+ +
+ +
+
+
+
+

+ Screenshots + + +

+

+ Show Booking Management.

+
+ +
+

+ Show Booking Management Admin Access +

+

+ Go to Setting --> Users --> enable Show Booking Management Admin.

+
+ +
+
+ +
+

+ Create New Show Type +

+

+ Create show type by specifying the name of the show type. +

+
+ +
+
+ +
+

+ Create New Cast Type +

+

+ Create cast type by specifying the name of the cast type. +

+
+ +
+
+ +
+

+ Create New Show Cast +

+

+ Create show cast by specifying the name, cast type and image of the cast. +

+
+ +
+
+ +
+

+ Create New Time Slots +

+

+ Create time slots by specifying the time in 24-hour format. +

+
+ +
+
+ +
+

+ Create New Show Screen +

+

+ Create a show screen by specifying the total number + of rows and the total number of columns per row. +

+
+ +
+
+ +
+

+ Create New Show +

+

+ Create shows by specifying the following required fields: + name, release date, show type, language, time slots, screen, + show start date, show end date, show poster, and price. Upon + creation, clicking the button 'Start Show' will change the + state of the show to ongoing. +

+
+ +
+
+
+

+ Website Show Menu +

+

+ Users can book shows by visiting the Show menu on the website. +

+
+ +
+
+
+

+ Ongoing Shows +

+

+ By visiting the menu, users can view ongoing shows. + Clicking the 'Book Now' button will redirect them to a new page. +

+
+ +
+
+
+

+ Movie Details +

+

+ On the page, users can view show details such as language, overview, cast, etc. + There will also be a form where user can specify the date, screen, and time slots, + with a button labeled 'Select Seats' to proceed. +

+
+ +
+
+
+

+ Seat Selection +

+

+ Users can select seats by clicking on them. + Additionally, users can change the time slot by + clicking on the respective buttons provided. +

+
+ +
+
+
+

+ Confirm Booking +

+

+ After selecting seats, a 'Confirm Booking' button will appear. + Clicking on this button will redirect the user to the + invoice page for finalizing the booking. +

+
+ +
+

+ Confirm the payment by clicking the 'Pay Now' button. + Once the payment is successful, your seats will be confirmed, + and the user will be notified via email. +

+
+ +
+
+ +
+
+
+

+ Download Ticket For User +

+

+ Users can download the ticket after payment by + clicking on the designated button. +

+
+ +
+
+
+

+ Downloaded Ticket +

+
+ +
+
+ +
+

+ Show Bookings +

+

+ Admin can view the bookings in the 'Show Bookings' menu. +

+
+ +
+

+ Admin can also download the ticket by clicking the button 'Download Ticket'. +

+
+ +
+
+
+
+ +
+
+
+

+

+
+

+ FEATURES + + +

+

+ Comprehensive Features of Show Booking Management

+
+
+
+
+
+
+ + + +
+ Interactive User Interface. +
+
+
+
+
+
+
+
+
+ + + +
+ Users can select seats. +
+
+
+
+
+
+
+
+
+ + + +
+ Users can choose from available time slots for a particular show. +
+
+
+
+
+
+
+
+
+ + + +
+ Users can confirm their booking by making a payment. +
+
+
+
+
+ +
+
+
+
+ + + +
+ Users can download their tickets after completing the payment process. +
+
+
+
+
+ +
+
+
+
+ + + +
+ Admin can create, edit, and manage shows including details + like name, release date, type, language, etc. +
+
+
+
+
+ +
+
+
+
+ +
+ +
+
+

+ FAQ + +

+
+
+
+
+ + + +
+
+

+ Yes, users can change the time slot by clicking the specified time slot button. +

+
+
+ + + +
+
+

+ Users receive an email notification confirming + their booking after successfully making the payment. + They can also download their tickets by clicking the designated button. +

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

+ RELEASE NOTES + + +

+
+
+
+
+
+

Version 17.0.1 I Released + on : 06th September 2024 +

+

Initial commit for show_booking_management

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

Related Modules

+

Explore our related modules

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

+ 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? Get in touch. +

+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get + in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+91 + 86068 + 27707

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

Skype

+

Say hi to us on Skype!

+ +

cybroopenerp +

+
+
+
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + + + + + + \ No newline at end of file diff --git a/show_booking_management/static/src/css/show_booking_management.css b/show_booking_management/static/src/css/show_booking_management.css new file mode 100644 index 000000000..8498482c3 --- /dev/null +++ b/show_booking_management/static/src/css/show_booking_management.css @@ -0,0 +1,137 @@ +.movie_details{ + display: -webkit-box; +} + +.param{ + margin-left:10px; +} + +.sidebar{ + max-width:280px; + margin-left: 20px; + margin-right:20px; + margin-bottom:20px; + padding: 20px; + background-color: #c9e3fd; + border: 1px solid #ddd; + border-radius: 5px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +.seating-chart-container { + position: relative; + display: ruby-text; + max-width: 100%; + overflow-x: auto; + user-select: none; +} + +.seating-chart { + flex-grow: 1; + overflow-x: auto; +} + +.seat-row { + display: flex; + align-items: center; + margin-bottom: 10px; +} + +.seat-row-inner { + display: flex; + gap: 10px; + margin-bottom: 10px; +} + +.seat-wrapper { + display: inline-block; +} + +.seat-label { + border-radius: 5px; + width: 30px; + height: 30px; + text-align: center; + line-height: 30px; + cursor: pointer; + background-color: #d3d3d3; +} + +.seat-checkbox { + display: none; +} + +.seat-checkbox:checked + .seat-label { + background-color: #28a745; + color: white; +} + +.seat-checkbox:disabled + .seat-label { + background-color: #dc3545; + color: white; + cursor: not-allowed; +} + +.screen{ + text-align: center; + background: darkseagreen; + padding: 10px; + margin-top: 5rem; + margin-bottom: 10px; + border-radius: 15px; +} + +.button-container { + position: absolute; + right: 25%; +} + +.seat-demo-booked{ + width: 30px; + height: 30px; + border-radius: 5px; + text-align: center; + line-height: 30px; + background-color: #dc3545; + color: white; +} + +.seat-demo-selected{ + width: 30px; + height: 30px; + border-radius: 5px; + text-align: center; + line-height: 30px; + background-color: #28a745; + color: white; +} + +.seat-demo-available{ + width: 30px; + height: 30px; + border-radius: 5px; + text-align: center; + line-height: 30px; + background-color: #d3d3d3; +} + +.card{ + min-width: 300px; + margin-right: 15px; + margin-top: 20px; + margin-bottom: 20px; +} + +.card-body{ + justify-content: center; +} + +.text{ + font-family: system-ui; + font-size: larger; +} + +.time-slot-btn { + margin: 5px; + cursor: pointer; +} diff --git a/show_booking_management/static/src/img/ticket (2).png b/show_booking_management/static/src/img/ticket (2).png new file mode 100644 index 000000000..28ab76729 Binary files /dev/null and b/show_booking_management/static/src/img/ticket (2).png differ diff --git a/show_booking_management/static/src/js/bookShow.js b/show_booking_management/static/src/js/bookShow.js new file mode 100644 index 000000000..2e7429e7b --- /dev/null +++ b/show_booking_management/static/src/js/bookShow.js @@ -0,0 +1,51 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { jsonrpc } from "@web/core/network/rpc_service"; + +publicWidget.registry.bookShow = publicWidget.Widget.extend({ + /* Extending widget and creating book show */ + selector: '.book_show', + events: { + 'change #choose_date' : 'CheckShows', + }, + CheckShows: function (ev) { + /* Function for validating date. */ + const selectedDate = new Date(ev.currentTarget.value); + const currentDate = new Date(); + selectedDate.setHours(0, 0, 0, 0); + currentDate.setHours(0, 0, 0, 0); + const movieId = this.$el.find('form')[0].dataset.movieId + this.$el.find('form')[0][4].value = '' + if (selectedDate < currentDate){ + ev.currentTarget.value = '' + this.$el.find('#error_box').text('Please select a date in the future!') + this.$el.find('#error_box').show() + } + else{ + this.$el.find('#error_box').hide() + this.checkShowsOnDate(ev, selectedDate, movieId); + } + }, + + checkShowsOnDate: function (ev, date, movieId) { + /* Function for checking shows on the selected date. */ + const formattedDate = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) + .toISOString().split('T')[0]; + return jsonrpc("/web/dataset/call_kw", { + model: 'movie.movie', + method: 'check_shows_on_date', + args: [formattedDate,movieId], + kwargs: {} + }).then((result) => { + if (!result){ + ev.currentTarget.value = '' + this.$el.find('#error_box').text('There is no shows on the selected date!!') + this.$el.find('#error_box').show() + this.$el.find('.tickets_section').hide() + } + else{ + this.$el.find('.tickets_section').show() + } + }) + }, +}); diff --git a/show_booking_management/static/src/js/selectSeat.js b/show_booking_management/static/src/js/selectSeat.js new file mode 100644 index 000000000..150404280 --- /dev/null +++ b/show_booking_management/static/src/js/selectSeat.js @@ -0,0 +1,57 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { jsonrpc } from "@web/core/network/rpc_service"; + +publicWidget.registry.selectSeat = publicWidget.Widget.extend({ + /* Extending widget and creating selectSeat */ + selector: '.seat-selection', + events: { + 'change .seat-checkbox': 'UpdateSeatCount', + 'click .time-slot-btn': 'UpdateSeatChart', + }, + UpdateSeatCount: function (ev) { + /* Function for hiding and showing the + confirm button based on selecting seats. */ + var checked_seats = this.$el.find('.seat-checkbox:checked:not(:disabled)') + if (checked_seats.length > 0){ + this.$el.find('.button-container').show() + this.$el.find('.selected-seats').show() + this.$el.find('.seat-demo-selected')[0].innerText = checked_seats.length + }else{ + this.$el.find('.button-container').hide() + this.$el.find('.selected-seats').hide() + } + }, + UpdateSeatChart: function(ev){ + /* Function for updating the seat chart and side bar contents + based on the clicking the time slots */ + this.$el.find('.time-slot-btn').removeClass('active'); + ev.currentTarget.classList.add("active") + this.$el.find('.seat-demo-selected')[0].innerText = 0; + const screenId = this.$el.find('input[name="screen_id"]').val(); + const timeSlotId = ev.currentTarget.dataset.timeSlotId + const booking_date = this.$el.find('input[name="booking_date"]').val(); + this.$el.find('input[name="time_slot_id"]').val(timeSlotId); + jsonrpc("/web/dataset/call_kw", { + model: 'movie.movie', + method: 'update_seats', + args: [screenId,timeSlotId,booking_date], + kwargs: {} + }).then((result) => { + this.$el.siblings().find('.sidebar_timeslot')[0].innerText = result.time_slot; + this.$el.siblings().find('.seat-demo-booked')[0].innerText = result.booked_seats_count; + this.$el.siblings().find('.seat-demo-available')[0].innerText = result.available_seats_count; + var bookedSeats = result.booked_seats; + this.$el.find('.seat-checkbox').each(function() { + var seatId = this.value; + if (bookedSeats.includes(seatId)) { + this.checked = true; + this.disabled = true; + } else { + this.checked = false; + this.disabled = false; + } + }); + }) + }, +}) diff --git a/show_booking_management/static/src/js/time_widget.js b/show_booking_management/static/src/js/time_widget.js new file mode 100644 index 000000000..f6b01a0ff --- /dev/null +++ b/show_booking_management/static/src/js/time_widget.js @@ -0,0 +1,35 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { useInputField } from "@web/views/fields/input_field_hook"; +const { Component, useRef } = owl; +/** + * We define this module for the function of creating a time picker widget + * + */ +export class FieldTimePicker extends Component { + setup() { + this.input = useRef('input_time'); + useInputField({ getValue: () => this.props.record.data[this.props.name] || "", refName: "input_time" }); + } + + onBlur(){ + /** + * Handle the blur event for the timepicker input field. + * + * This function is responsible for handling the blur event on the timepicker input field. + * It checks if the close button is present in the timepicker, and if so, it adds a click event + * listener to it to handle the closing of the timepicker. + * + * @returns {void} + */ + this.props.record.update({ [this.props.name] : this.input.el?.value}) + } +} +// Set the template for the FieldTimePicker component +FieldTimePicker.template = 'FieldTimePicker'; +FieldTimePicker.supportedTypes = ["char"] +export const timepicker = { + component: FieldTimePicker + } +// Add the timepicker to the fields category +registry.category("fields").add("timepicker_time", timepicker); diff --git a/show_booking_management/static/src/xml/timepicker.xml b/show_booking_management/static/src/xml/timepicker.xml new file mode 100644 index 000000000..d72d6d4e9 --- /dev/null +++ b/show_booking_management/static/src/xml/timepicker.xml @@ -0,0 +1,9 @@ + + + + +
+ +
+
+
diff --git a/show_booking_management/views/cast_type_views.xml b/show_booking_management/views/cast_type_views.xml new file mode 100644 index 000000000..69c48be4a --- /dev/null +++ b/show_booking_management/views/cast_type_views.xml @@ -0,0 +1,22 @@ + + + + + cast.type.view.tree + cast.type + + + + + + + + + Cast Type + cast.type + tree + + + + diff --git a/show_booking_management/views/movie_cast_views.xml b/show_booking_management/views/movie_cast_views.xml new file mode 100644 index 000000000..e0f30f927 --- /dev/null +++ b/show_booking_management/views/movie_cast_views.xml @@ -0,0 +1,45 @@ + + + + + movie.cast.view.form + movie.cast + +
+ + + + + + + + + + + +
+
+
+ + + movie.cast.view.tree + movie.cast + + + + + + + + + + + Show Cast + movie.cast + tree,form + + + +
diff --git a/show_booking_management/views/movie_movie_views.xml b/show_booking_management/views/movie_movie_views.xml new file mode 100644 index 000000000..6db3474f8 --- /dev/null +++ b/show_booking_management/views/movie_movie_views.xml @@ -0,0 +1,158 @@ + + + + + movie.movie.view.search + movie.movie + + + + + + + + + + + + + + + + + movie.movie.view.kanban + movie.movie + + + + + + + + + + +
+
+ Movie Poster +
+
+ + + +
    +
  • + Language: + + +
  • +
  • + Price: + + +
  • +
  • + Show Type: + + +
  • +
  • + Time Slots: + + +
  • +
  • + Screen: + + +
  • +
+
+
+
+
+
+
+
+ + + movie.movie.view.form + movie.movie + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + movie.movie.view.tree + movie.movie + + + + + + + + + Shows + movie.movie + kanban,form,tree + + + + + + +
diff --git a/show_booking_management/views/movie_registration_views.xml b/show_booking_management/views/movie_registration_views.xml new file mode 100644 index 000000000..4cfe2cea3 --- /dev/null +++ b/show_booking_management/views/movie_registration_views.xml @@ -0,0 +1,110 @@ + + + + + movie.registration.view.search + movie.registration + + + + + + + + + + + + + + + + + movie.registration.view.form + movie.registration + +
+
+
+ +
+
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + movie.registration.view.tree + movie.registration + + + + + + + + + + + + + Show Bookings + movie.registration + tree,form + + + +
diff --git a/show_booking_management/views/movie_screen_views.xml b/show_booking_management/views/movie_screen_views.xml new file mode 100644 index 000000000..f1008bbf7 --- /dev/null +++ b/show_booking_management/views/movie_screen_views.xml @@ -0,0 +1,44 @@ + + + + + movie.screen.view.form + movie.screen + +
+ +
+

+ +

+ + + + + +
+
+
+
+
+ + + movie.screen.view.tree + movie.screen + + + + + + + + + + Show Screen + movie.screen + tree,form + + + +
diff --git a/show_booking_management/views/portal_template.xml b/show_booking_management/views/portal_template.xml new file mode 100644 index 000000000..e3da161e5 --- /dev/null +++ b/show_booking_management/views/portal_template.xml @@ -0,0 +1,62 @@ + + + + + + + + + diff --git a/show_booking_management/views/show_type_views.xml b/show_booking_management/views/show_type_views.xml new file mode 100644 index 000000000..55d08374d --- /dev/null +++ b/show_booking_management/views/show_type_views.xml @@ -0,0 +1,22 @@ + + + + + show.type.view.tree + show.type + + + + + + + + + Show Type + show.type + tree + + + + diff --git a/show_booking_management/views/time_slots_views.xml b/show_booking_management/views/time_slots_views.xml new file mode 100644 index 000000000..3e570cc5e --- /dev/null +++ b/show_booking_management/views/time_slots_views.xml @@ -0,0 +1,41 @@ + + + + + time.slots.view.form + time.slots + +
+ +
+

+ +

+
+ + + +
+
+
+
+ + + time.slots.view.tree + time.slots + + + + + + + + + Time Slots + time.slots + tree,form + + + +
diff --git a/show_booking_management/views/website_templates.xml b/show_booking_management/views/website_templates.xml new file mode 100644 index 000000000..1902e9f80 --- /dev/null +++ b/show_booking_management/views/website_templates.xml @@ -0,0 +1,356 @@ + + + + + + + + + + +