diff --git a/venue_booking_management/README.rst b/venue_booking_management/README.rst new file mode 100644 index 000000000..739ab20a7 --- /dev/null +++ b/venue_booking_management/README.rst @@ -0,0 +1,55 @@ +.. 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 + +Venue / Event Booking Management +================================ +The 'Venue / Event Booking Management' is a core module which can manage any type of venue reservation. + +Features +======== +* Venue Booking creation. +* Allocate the Booking to different users. +* Integrated with Accounting module. +* Simple Workflow. +* Attractive Design. + +Configuration +============= +* No additional configurations needed + +License +------- +Gnu Affero General Public License, v3.0 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer : (V16) Risvana AR, + (V17) Farhana Jahan PT,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/venue_booking_management/__init__.py b/venue_booking_management/__init__.py new file mode 100644 index 000000000..822511fa5 --- /dev/null +++ b/venue_booking_management/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 controllers +from . import models +from . import report +from . import wizards diff --git a/venue_booking_management/__manifest__.py b/venue_booking_management/__manifest__.py new file mode 100644 index 000000000..8e20ca6fc --- /dev/null +++ b/venue_booking_management/__manifest__.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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': 'Venue / Event Booking Management', + 'version': '17.0.1.0.0', + 'summary': 'Core Module for Managing Different Types of ' + 'Venue/ Event Booking.', + 'description': 'Core Module for Managing Different Types of ' + 'Venue/ Event Booking, Event Booking, Venue Booking, ' + 'Space Booking, Booking, Event, Venue, Wedding, Birthday, ' + 'Party, Hall Booking, Room Booking', + "category": "Account/Website", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['base', 'account', 'website'], + 'website': "https://www.cybrosys.com", + 'data': [ + 'security/venue_booking_management_groups.xml', + 'security/ir.model.access.csv', + 'data/venue_type_data.xml', + 'data/confirmation_email_template_data.xml', + 'views/venue_booking_views.xml', + 'views/venue_type_views.xml', + 'views/amenities_views.xml', + 'views/venue_views.xml', + 'views/dashboard_views.xml', + 'views/res_partner_views.xml', + 'views/res_config_settings_views.xml', + 'wizards/check_venue_availability_views.xml', + 'report/venue_booking_report_views.xml', + 'report/venue_booking_report_templates.xml', + 'report/venue_booking_rerports.xml', + 'wizards/venue_booking_analysis_views.xml', + 'views/website_venue_booking_templates.xml', + 'views/website_portal_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'venue_booking_management/static/src/css/website_page.css', + 'venue_booking_management/static/src/js/website_venue_booking.js' + ], + 'web.assets_backend': [ + 'https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap', + 'venue_booking_management/static/src/css/venue_dashboard.css', + 'venue_booking_management/static/src/scss/venue_booking.scss', + 'venue_booking_management/static/src/xml/dashboard_templates.xml', + 'venue_booking_management/static/src/js/action_manager.js', + 'venue_booking_management/static/src/js/dashboard_action.js', + 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.0/chart.umd.min.js' + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, +} + diff --git a/venue_booking_management/controllers/__init__.py b/venue_booking_management/controllers/__init__.py new file mode 100644 index 000000000..372b63fe1 --- /dev/null +++ b/venue_booking_management/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 portal +from . import venue_booking_management diff --git a/venue_booking_management/controllers/portal.py b/venue_booking_management/controllers/portal.py new file mode 100644 index 000000000..6bd02fe13 --- /dev/null +++ b/venue_booking_management/controllers/portal.py @@ -0,0 +1,264 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 collections import OrderedDict +from datetime import timedelta +from odoo.addons.portal.controllers import portal +from odoo.addons.portal.controllers.portal import CustomerPortal, \ + pager as portal_pager +from odoo import fields, http, _ +from odoo.http import request +from odoo.osv import expression +from odoo.osv.expression import OR + + +class CustomerPortal(portal.CustomerPortal): + """Class for Venue booking portal that gives the record and + counts of the Bookings""" + + def _prepare_home_portal_values(self, counters): + """ Function for finding the number of document """ + values = super()._prepare_home_portal_values(counters) + uid = request.env.user.partner_id.id + venue_booking_count = request.env['venue.booking'].search_count( + [('partner_id', '=', uid)]) + values.update({'venue_booking_count': venue_booking_count}) + return values + + @http.route(['/my/venue_booking', '/my/venue_booking/page/'], + type='http', auth='user', + website=True) + def create_venue_booking_management(self, page=1, date_begin=None, + date_end=None, + sortby=None, filterby=None, + search=None, + search_in='content', ): + """ Function to fetch booking records and pass to the portal template""" + uid = request.env.user.partner_id.id + venue_booking_management = request.env['venue.booking'].sudo().search( + [('partner_id', '=', uid)]) + values = self._prepare_my_booking_values(page, date_begin, date_end, + sortby, filterby, search, + search_in) + # Pager + pager = portal_pager(**values['pager']) + venue = values['venue'](pager['offset']) + request.session['my_venue_booking_history'] = venue.ids[:100] + values.update({ + 'venue_booking_management': venue_booking_management, + 'venues': venue, + 'pager': pager, + }) + return request.render( + "venue_booking_management.portal_my_venue_booking_documents", + values) + + def _prepare_my_booking_values(self, page, date_begin, date_end, sortby, + filterby, search, search_in, + domain=None, url="/my/venue_booking"): + """Add all event values to the portal. Which will return the + values event, page, pager, filter, sort, and search""" + values = self._prepare_portal_layout_values() + Venue = request.env['venue.booking'] + domain = expression.AND([ + domain or [], + self._get_booking_domain(), + ]) + searchbar_sortings = self._get_venue_booking_searchbar_sortings() + # default sort by order + if not sortby: + sortby = 'date' + order = searchbar_sortings[sortby]['order'] + searchbar_filters = self._get_venue_booking_searchbar_filters() + # default filter by value + if not filterby: + filterby = 'all' + domain += searchbar_filters[filterby]['domain'] + searchbar_inputs = self._get_venue_booking_searchbar_inputs() + if search and search_in: + domain += self._get_venue_booking_search_domain(search_in, search) + if date_begin and date_end: + domain += [('create_date', '>', date_begin), + ('create_date', '<=', date_end)] + values.update({ + 'date': date_begin, + 'venue': lambda pager_offset: self._get_grouped_venues(Venue, + domain, + order, + pager_offset), + 'page_name': 'venue_booking', + 'pager': { + "url": url, + "url_args": {'date_begin': date_begin, 'date_end': date_end, + 'sortby': sortby, 'search_in': search_in, + 'search': search}, + "total": Venue.search_count(domain), + "page": page, + "step": self._items_per_page, + }, + 'default_url': url, + 'searchbar_sortings': searchbar_sortings, + 'sortby': sortby, + 'searchbar_filters': OrderedDict( + sorted(searchbar_filters.items())), + 'filterby': filterby, + 'searchbar_inputs': searchbar_inputs, + 'search_in': search_in, + 'search': search, + }) + return values + + def _get_venue_page_view_values(self, venue, access_token, **kwargs): + """Get the page view values""" + values = { + 'venue': venue, + 'page_name': 'venue_booking', + } + return self._get_page_view_values(venue, access_token, values, + 'my_venue_booking_history', False, + **kwargs) + + def _get_booking_domain(self): + """Returns the booking that are in stage 'cancel' and 'draft'""" + return [('state', 'not in', ('cancel', 'closed'))] + + def _get_venue_booking_searchbar_sortings(self): + """Sort the booking based on the date and name""" + return { + 'date': {'label': _('Date'), 'order': 'create_date desc'}, + 'name': {'label': _('Name'), 'order': 'name asc'}, + } + + def _get_venue_booking_searchbar_filters(self): + """Filter the events by All, Last month, This Month, Last Week, + This Week, Last Year, This Year, Today and This Quarter""" + today = fields.Date.today() + this_month_start = today.replace(day=1) + this_quarter_start = today.replace(day=1, month=(( + today.month - 1) // 3) * 3 + 1) + this_week_start = today - timedelta(days=today.weekday()) + this_year_start = today.replace(month=1, day=1) + return { + 'all': {'label': _('All'), 'domain': []}, + 'last_month': { + 'label': _('Last Month'), + 'domain': [('create_date', '>=', + (this_month_start - timedelta(days=30)).strftime( + '%Y-%m-%d')), + ('create_date', '<=', + (this_month_start - timedelta(days=1)).strftime( + '%Y-%m-%d'))] + }, + 'this_month': { + 'label': _('This Month'), + 'domain': [ + ( + 'create_date', '>=', + this_month_start.strftime('%Y-%m-%d')), + ('create_date', '<=', today.strftime('%Y-%m-%d'))] + }, + 'last_week': { + 'label': _('Last Week'), + 'domain': [('create_date', '>=', + (this_week_start - timedelta(days=7)).strftime( + '%Y-%m-%d')), + ('create_date', '<=', + (this_week_start - timedelta(days=1)).strftime( + '%Y-%m-%d'))] + }, + 'this_week': { + 'label': _('This Week'), + 'domain': [ + ( + 'create_date', '>=', + this_week_start.strftime('%Y-%m-%d')), + ('create_date', '<=', today.strftime('%Y-%m-%d'))] + }, + 'last_year': { + 'label': _('Last Year'), + 'domain': [('create_date', '>=', + (this_year_start - timedelta(days=365)).strftime( + '%Y-%m-%d')), + ('create_date', '<=', + (this_year_start - timedelta(days=1)).strftime( + '%Y-%m-%d'))] + }, + 'this_year': { + 'label': _('This Year'), + 'domain': [ + ( + 'create_date', '>=', + this_year_start.strftime('%Y-%m-%d')), + ('create_date', '<=', today.strftime('%Y-%m-%d'))] + }, + 'today': { + 'label': _('Today'), + 'domain': [('create_date', '=', today.strftime('%Y-%m-%d'))] + }, + 'this_quarter': { + 'label': _('This Quarter'), + 'domain': [ + ('create_date', '>=', + this_quarter_start.strftime('%Y-%m-%d')), + ('create_date', '<=', today.strftime('%Y-%m-%d'))] + } + } + + def _get_venue_booking_search_domain(self, search_in, search): + """Returns the events for the given search(If we have not entered + the full name which will also gives the output""" + search_domain = [] + if search_in == 'all': + search_domain.append([('name', 'ilike', + f'{search}%')]) + search_domain.append([('phone', 'ilike', + f'{search}%')]) + if search_in in ('venue', 'all'): + search_domain.append([('venue_id', 'ilike', + f'{search}%')]) + return OR(search_domain) + + def _get_venue_booking_searchbar_inputs(self): + """Which will returns a dictionary of values by the search contents + as Search in All, in Content, Search in states, Search in Venues""" + values = { + 'all': {'input': 'all', 'label': _('Search in All'), 'order': 1}, + 'venue': {'input': 'venue', 'label': _('Search in Venue'), + 'order': 2}, + } + return dict(sorted(values.items(), key=lambda item: item[1]["order"])) + + def _get_grouped_venues(self, Venue, domain, order, pager_offset, ): + """Returns the grouped venues for a given domain""" + venues = Venue.search(domain, order=order, limit=self._items_per_page, + offset=pager_offset) + return venues + + @http.route(['/my/booking_data/'], type='http', + auth="user", website=True) + def portal_my_venue_booking(self, record): + """ Function to fetch data of selected visitors record and pass to + the portal template""" + booking_record = request.env['venue.booking'].sudo().browse(record) + return http.request.render( + 'venue_booking_management.booking_portal_form', + {'booking_record': booking_record, + 'page_name': 'venue_booking_management_record'}) diff --git a/venue_booking_management/controllers/venue_booking_management.py b/venue_booking_management/controllers/venue_booking_management.py new file mode 100644 index 000000000..ad27d30c0 --- /dev/null +++ b/venue_booking_management/controllers/venue_booking_management.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 . +# +############################################################################### +import json +from odoo import fields, http +from odoo.http import content_disposition, request +from odoo.http import serialize_exception as _serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """Controller Class for xlsx report""" + + @http.route('/venue_xlsx_reports', type='http', auth='user', + methods=['POST']) + def get_report_xlsx(self, model, options, output_format, report_name): + """Method for passing data to xlsx report""" + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + options = json.loads(options) + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[('Content-Type', 'application/vnd.ms-excel'), ( + 'Content-Disposition', + content_disposition(report_name + '.xlsx'))]) + report_obj.get_xlsx_report(options, response) + return response + except Exception as err: + exception = _serialize_exception(err) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': exception + } + return request.make_response(html_escape(json.dumps(error))) + + +class VenueBookingController(http.Controller): + """Class to add Venue booking menu in website""" + + @http.route('/venue/booking', type='http', auth='public', website=True) + def venue_booking(self): + """Function to render venue booking values to XML""" + venue_ids = request.env['venue'].sudo().search([]) + state_ids = request.env['res.country.state'].sudo().search([]) + country_ids = request.env['res.country'].sudo().search([]) + return http.request.render( + 'venue_booking_management.venue_booking_page', + {'venue_ids': venue_ids, + 'state_ids': state_ids, + 'country_ids': country_ids}) + + @http.route('/booking/submit', type='http', auth='public', website=True) + def booking_success_page(self, **post): + """Function to create booking and return to success page""" + partner_id = request.env['res.partner'].sudo().create({ + 'name': post.get('name'), + 'mobile': post.get('mobile_no'), + 'city': post.get('city'), + 'state_id': post.get('state'), + 'country_id': post.get('country') + }) + venue_id = request.env['venue'].browse(int(post.get('venue_type'))) + values = { + 'partner_id': partner_id.id, + 'venue_id': venue_id.id, + 'start_date': post.get('from_date'), + 'end_date': post.get('to_date'), + 'booking_type': post.get('booking_type'), + 'date': fields.Date.today() + } + booking_id = request.env['venue.booking'].sudo().create(values) + return request.render( + 'venue_booking_management.venue_booking_success_page', + {'partner_id': partner_id, + 'booking_id': booking_id}) diff --git a/venue_booking_management/data/confirmation_email_template_data.xml b/venue_booking_management/data/confirmation_email_template_data.xml new file mode 100644 index 000000000..b24100844 --- /dev/null +++ b/venue_booking_management/data/confirmation_email_template_data.xml @@ -0,0 +1,30 @@ + + + + + + Confirmed Venue Booking + Venue booking: Received the Venue Booking for + {{ object.venue_id.name }} + + + {{ (object.env.user.login) }} + + + + Dear customer ,

+ We have received a booking for the venue + . Please proceed + with necessary actions. +

+ Thank You +

+ ]]> +
+ {{ object.partner_id.lang or '' }} + +
+
+
diff --git a/venue_booking_management/data/venue_type_data.xml b/venue_booking_management/data/venue_type_data.xml new file mode 100644 index 000000000..2d5d10601 --- /dev/null +++ b/venue_booking_management/data/venue_type_data.xml @@ -0,0 +1,60 @@ + + + + + + Conference centers + + + + Meeting Room + + + + Convention centers + + + + Social clubs and lounges + + + + Mini Conference centers + + + + Stadiums + + + + Community centers + + + + Resorts + + + + Auditorium + + + + + Venue Booking + venue.booking.sequence + %(day)s/%(month)s/%(year)s + VENUE- + 1 + 3 + + + diff --git a/venue_booking_management/doc/RELEASE_NOTES.md b/venue_booking_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..68def998b --- /dev/null +++ b/venue_booking_management/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 23.01.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for Venue / Event Booking Management diff --git a/venue_booking_management/models/__init__.py b/venue_booking_management/models/__init__.py new file mode 100644 index 000000000..b649a37bf --- /dev/null +++ b/venue_booking_management/models/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 amenities +from . import res_config_settings +from . import venue +from . import venue_booking +from . import venue_booking_line +from . import venue_lines +from . import venue_type diff --git a/venue_booking_management/models/amenities.py b/venue_booking_management/models/amenities.py new file mode 100644 index 000000000..84a0bcd76 --- /dev/null +++ b/venue_booking_management/models/amenities.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 FITNproduct_id.ESS 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 Amenities(models.Model): + """Model for managing the Amenities""" + _name = 'amenities' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Amenities' + + name = fields.Char(string="Name", help="Name of the Amenities") + amount = fields.Float(string='Amount', help="Amount of the Amenities") diff --git a/venue_booking_management/models/res_config_settings.py b/venue_booking_management/models/res_config_settings.py new file mode 100644 index 000000000..a8d7caf70 --- /dev/null +++ b/venue_booking_management/models/res_config_settings.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 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 ResConfigSettings(models.TransientModel): + """Inherit the model res.config.settings to add Additional fields""" + _inherit = 'res.config.settings' + + is_extra = fields.Boolean(string='Apply Extra Amount', + config_parameter='venue_booking_management.is_extra', + help="Enable, if extra charge want to add") + extra_amount = fields.Float(string='Extra Amount', + config_parameter='venue_booking_management.extra_amount', + help='Enter extra amount/KM') diff --git a/venue_booking_management/models/venue.py b/venue_booking_management/models/venue.py new file mode 100644 index 000000000..f3ed22d64 --- /dev/null +++ b/venue_booking_management/models/venue.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 api, fields, models + + +class Venue(models.Model): + """Model for managing the Venue that used to add new fields and + functions to create the Venue""" + _name = 'venue' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Venue' + + name = fields.Char(string="Name", help="Name of the venue type", + required=True) + image = fields.Binary(string="Image", attachment=True, + related="venue_type_id.image", + help="This field holds the image used as " + "image for the event, limited to 1080x720px.") + venue_type_id = fields.Many2one('venue.type', + string='Venue Type', required=True, + help='Used to choose the type of the ' + 'particular venue') + venue_location = fields.Char(string='Location', required=True, + help='The venue location for Booking') + capacity = fields.Integer(string='Capacity', + help='The capacity of the venue') + seating = fields.Integer(string='Seating', help='The Seating of the venue') + venue_charge_hour = fields.Float(string='Charge Per Hour', + help='The charge per hour of the venue') + venue_charge_day = fields.Float(string='Charge Per Day', + help='The charge per day of the venue') + additional_charge_hour = fields.Float(string=' Additional Charge Per Hour', + help='The charge per hour of the ' + 'venue') + additional_charge_day = fields.Float(string='Additional Charge Per Day', + help='The charge per day of the venue') + venue_count = fields.Integer(string="# of Events", + compute='_compute_venue_count', + help='Compute field for calculate the ' + 'venue count') + open_time = fields.Float(string=' Open Time', help='Open time of the venue') + closed_time = fields.Float(string=' Close Time', + help='Close time of the venue') + venue_line_ids = fields.One2many('venue.lines', + 'venue_id', string='Amenities', + help='Amenities for the venue') + price_subtotal = fields.Float(string='Total', + help='Total price of the venue', + compute='_compute_price_subtotal', + readonly=True, store=True) + + @api.depends('venue_line_ids', 'venue_line_ids.sub_total') + def _compute_price_subtotal(self): + """Compute function for calculating the Amenities Price Subtotal""" + self.price_subtotal = sum( + item.sub_total for item in self.venue_line_ids) + + def _compute_venue_count(self): + """Compute function for calculating the venue count""" + for records in self: + venues = self.env['venue.booking'].search([ + ('venue_id', '=', records.id)]) + records.venue_count = len(venues) + + def get_venue_type_action(self): + """Get the venue type action for the venue bookings""" + return self._get_action( + 'venue_booking_management.venue_booking_action_view_kanban') diff --git a/venue_booking_management/models/venue_booking.py b/venue_booking_management/models/venue_booking.py new file mode 100644 index 000000000..ee1e34877 --- /dev/null +++ b/venue_booking_management/models/venue_booking.py @@ -0,0 +1,489 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 markupsafe import Markup + +from odoo import api, fields, models, _ +from odoo.exceptions import UserError, ValidationError + + +class VenueBooking(models.Model): + """Model for managing the Venue Booking""" + _name = 'venue.booking' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Venue Reservation' + + name = fields.Char(string="Name", help="Name of the venue type") + ref = fields.Char(string='Ref', readonly=True, + help="Name of the venue that created as sequencing") + venue_id = fields.Many2one('venue', string='Venue', + help="Venue for the Event", required=True) + venue_type_id = fields.Many2one('venue.type', + string='Venue Type', + related='venue_id.venue_type_id', + readonly=True, + help='Used to choose the type of the ' + 'particular venue') + image = fields.Binary(string="Image", attachment=True, + related='venue_type_id.image', + help="This field holds the image used as " + "image for the event, limited to 1080x720px.") + partner_id = fields.Many2one('res.partner', string="Customer", + required=True, + help='Used to Choose the Booking Person') + date = fields.Date(string="Date", default=fields.Date.today, required=True, + help='Date field for booking the Venue') + currency_id = fields.Many2one('res.currency', readonly=True, + string='Currency', + default=lambda self: + self.env.user.company_id.currency_id, + help='Currency field for booking Venue') + start_date = fields.Datetime(string="Start Date", + default=lambda self: fields.datetime.now(), + required=True, + help='Venue Booking Start Date') + end_date = fields.Datetime(string="End Date", required=True, + help='Venue Booking End Date') + state = fields.Selection([('draft', 'Draft'), + ('confirm', 'Confirmed'), + ('invoice', 'Invoiced'), + ('close', 'Close'), ('cancel', 'Canceled')], + string="State", default="draft", + help="State of venue booking") + booking_type = fields.Selection([('day', 'Day'), + ('hour', 'Hours')], string='Booking Type', + default='day', + help='The selection field for Booking Type') + venue_booking_line_ids = fields.One2many('venue.booking.line', + 'venue_booking_id', + string="Venues", + help='Booking Line for the ' + 'given venue') + note = fields.Text(string='Terms and Conditions', + help='The note field for Venue Booking') + pending_invoice = fields.Boolean(string="Invoice Pending", + compute='_compute_pending_invoice', + help='Find out is there any pending ' + 'invoice') + total = fields.Monetary(string="Total Amount", store=True, + compute='_compute_total_amount', + help='Total amount for the Venue Booking') + booking_charge_per_day = fields.Float(string="Booking Charge Per Day", + related='venue_id.venue_charge_day', + help='Field for adding Booking ' + 'Charge Per Day') + booking_charge_per_hour = fields.Float(string="Booking Charge Per Hour", + related='venue_id.venue_charge_hour', + help='Field for adding Booking ' + 'Charge Per hour') + booking_charge = fields.Float(string="Venue Amenities Charge", + compute='_compute_booking_charge', + help='Compute the total Booking cost ' + 'includes the amenities') + days_difference = fields.Integer(string='Days Difference', + compute='_compute_days_difference', + help='Number of Days to Booking the venue') + invoice_count = fields.Integer(string="Invoice Count", + compute='_compute_invoice_count', + help='Total invoice count') + is_additional_charge = fields.Boolean(string="Add Extra Charge?", + help='Add additional charge ' + 'for the booking') + is_extra_check = fields.Boolean(string="Checks Additional Charges", + help='Checks additional charge ' + 'is enabled on settings', + default=lambda self: self.env[ + 'ir.config_parameter'].sudo().get_param( + 'venue_booking_management.is_extra')) + amenity_line_ids = fields.One2many('venue.booking.line', + 'venue_booking_id', + string="Included Amenities", + help='Booking Line for the given venue') + + @api.constrains('venue_booking_line_ids') + def _check_venue_booking_line_ids(self): + """Check if the venue bookings line contains already taken amenities""" + amenities_list = [] + name_list = [] + if self.venue_id.venue_line_ids: + amenities = self.venue_id.venue_line_ids.mapped('amenities_id') + for line in self.venue_booking_line_ids: + if line.amenity_id in amenities: + amenities_list.append(line.amenity_id) + name_list.append(line.amenity_id.name) + if amenities_list: + names = ', '.join(name_list) + raise ValidationError( + _("Amenities %s are already Include in Your Venue Booking %s" + % (str(names), str(self.venue_id.name)))) + + @api.model + def create(self, values): + """Create method for sequencing and checking dates while Booking the + Venues""" + partner_name = self.env['res.partner'].browse( + values['partner_id']).name + if values['start_date'] >= values['end_date']: + raise UserError(_('Start date must be less than End date')) + values['name'] = '%s- %s' % (partner_name, values['date']) + values['ref'] = self.env['ir.sequence'].next_by_code( + 'venue.booking.sequence') + res = super().create(values) + return res + + @api.onchange('start_date', 'end_date') + def _onchange_booking_dates(self): + """Checking dates while Booking the Venues based on the changes + of the Dates""" + if self.venue_id: + booking = self.env['venue.booking'].search( + [('start_date', '<', self.end_date), + ('end_date', '>', self.start_date), + ('venue_id', '=', self.venue_id.id)]) + if booking: + raise ValidationError( + "Venue is not available for the selected time range.") + + @api.depends('start_date', 'end_date') + def _compute_days_difference(self): + """Compute the difference between start and end dates for + Calculating the days""" + for record in self: + if record.start_date and record.end_date: + delta = record.end_date - record.start_date + record.days_difference = delta.days + else: + record.days_difference = 0 + + @api.depends('booking_charge', 'venue_id') + def _compute_booking_charge(self): + """Compute booking charge for the given venue with the Amenities""" + for rec in self: + rec.booking_charge = rec.venue_id.price_subtotal if rec.venue_id else 0.0 + + @api.depends('venue_booking_line_ids', 'venue_booking_line_ids.state') + def _compute_pending_invoice(self): + """Compute function for finding the pending Invoices""" + for pending in self: + pending.pending_invoice = any( + not line.is_invoiced and line.state == "done" for line in + pending.venue_booking_line_ids) + + @api.depends('venue_booking_line_ids.sub_total', 'booking_charge_per_hour', + 'booking_charge_per_day') + def _compute_total_amount(self): + """Compute total amount of bookings with the Charge of the Particular + venue""" + total = sum(item.sub_total for item in self.venue_booking_line_ids) + for rec in self: + if rec.booking_type == 'day': + total += (rec.booking_charge_per_day * rec.days_difference) + if rec.venue_id.additional_charge_day != 0.0: + total += rec.venue_id.additional_charge_day + elif rec.booking_type == 'hour': + total += (rec.booking_charge_per_hour * rec.days_difference) + if rec.venue_id.additional_charge_hour != 0.0: + total += rec.venue_id.additional_charge_hour + rec.total = total + rec.booking_charge + + @api.constrains('start_date', 'end_date', 'venue_id') + def check_date_overlap(self): + """Check the date overlap between the start and end dates""" + for booking in self: + overlapping_bookings = self.env['venue.booking'].search([ + ('venue_id', '=', booking.venue_id.id), + ('start_date', '<', booking.end_date), + ('end_date', '>', booking.start_date), + ('id', '!=', booking.id), # Exclude the current record itself + ]) + if overlapping_bookings: + raise ValidationError( + "Booking dates overlap with existing bookings.") + + def action_booking_confirm(self): + """Button action to confirm""" + for booking in self: + bookings = self.env['venue.booking'].search([ + ('venue_id', '=', booking.venue_id.id), + ('start_date', '<', booking.end_date), + ('end_date', '>', booking.start_date), + ('id', '!=', booking.id), # Exclude the current record itself + ]) + if bookings: + raise ValidationError( + "Booking dates overlap with existing bookings.") + else: + self.state = "confirm" + + def action_reset_to_draft(self): + """Button action to reset""" + self.state = "draft" + + def action_send_confirmation_mail(self): + """Button action to send confirmation mail""" + template = self.env.ref( + 'venue_booking_management.mail_template_notify_venue_booking').sudo() + template.send_mail(self._origin.id, force_send=True, + email_values={ + 'email_to': self.partner_id.email}) + for rec in self: + body = Markup( + "

%(greeting)s

%(content)s

%(conclude)s

") % { + 'greeting': _("Dear %s", rec.partner_id.name), + 'content': _( + "We have received a booking for the venue %s.Please proceed with necessary actions.", + rec.venue_id.name), + 'conclude': _('Thank You'), + } + rec.message_post(body=body) + + def action_booking_invoice_create(self): + """Button action to create related invoice""" + invoice_id = self.env['account.move'].search( + [('invoice_origin', '=', self.ref), ('state', '=', 'draft')]) + amenity_lists = [] + + def add_charge(name, price_unit, quantity=1): + amenity_lists.append({ + 'name': name, + 'price_unit': price_unit, + 'quantity': quantity, + }) + + if self.booking_type == 'day': + total = self.booking_charge_per_day + self.venue_id.additional_charge_day + elif self.booking_type == 'hour': + total = self.booking_charge_per_hour + self.venue_id.additional_charge_hour + else: + total = 0 + add_charge('Amenities charge', self.booking_charge) + add_charge('Booking Charges', total) + for rec in self.venue_booking_line_ids: + add_charge(rec.amenity_id.name, rec.amount, rec.quantity) + if self.is_additional_charge: + is_extra = self.env['ir.config_parameter'].sudo(). \ + get_param('venue_booking_management.is_extra') + if is_extra: + amount = self.env['ir.config_parameter'].sudo(). \ + get_param('venue_booking_management.extra_amount') + amenity_lists.append({ + 'name': 'Extra charges', + 'price_unit': amount, + 'quantity': '1', + }) + invoice_vals = { + 'move_type': 'out_invoice', + 'partner_id': self.partner_id.id, + 'invoice_origin': self.ref, + 'invoice_line_ids': [(0, 0, line) for line in amenity_lists], + } + if not invoice_id: + invoice = self.env['account.move'].create([invoice_vals]) + self.state = "invoice" + return { + 'name': 'Invoice', + 'view_mode': 'form', + 'res_id': invoice.id, + 'res_model': 'account.move', + 'type': 'ir.actions.act_window', + 'target': 'current', + } + else: + # Unlink existing lines + invoice_id.invoice_line_ids.unlink() + invoice_id.write( + {'invoice_line_ids': [(0, 0, line) for line in amenity_lists]}) + self.state = "invoice" + return { + 'name': 'Invoice', + 'view_mode': 'form', + 'res_id': invoice_id.id, + 'res_model': 'account.move', + 'type': 'ir.actions.act_window', + 'target': 'current', + } + + def action_view_invoice(self): + """Smart button to view the Corresponding Invoices for the + Venue Booking""" + return { + 'type': 'ir.actions.act_window', + 'name': 'Invoice', + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'target': 'current', + 'domain': [('invoice_origin', '=', self.ref)], + 'context': {"create": False}, + } + + def _compute_invoice_count(self): + """Function to count invoice""" + for record in self: + record.invoice_count = self.env['account.move']. \ + search_count([('invoice_origin', '=', self.ref)]) + + def action_booking_cancel(self): + """Button action to move the cancel state""" + self.state = "cancel" + + def action_booking_close(self): + """Button action to close the records""" + if any(not line.is_invoiced for line in self.venue_booking_line_ids): + raise ValidationError(_('You can close The Booking only when all ' + 'Procedure is Done and Invoiced')) + else: + self.state = "close" + + @api.model + def get_total_booking(self): + """Function to get total booking, distance and invoice amount details""" + total_booking = self.env['venue.booking'].search_count([]) + booking_ids = self.env['venue.booking'].search( + [('state', 'not in', ['draft', 'cancel', 'close'])]) + invoice_ids = self.env['venue.booking']. \ + search([('state', '=', 'invoice')]).mapped('total') + venue_ids = self.env['venue'].search_count([]) + return {'total_booking': total_booking, + 'total_invoice': sum(invoice_ids), + 'total_amount': sum(booking_ids.mapped('total')), + 'total_venue': venue_ids} + + @api.model + def get_top_venue(self): + """Function to return top venue and customer details query to js""" + self.env.cr.execute('''select fv.name,count(tb.name) from venue_booking as tb + inner join venue as fv on fv.id = tb.venue_id + group by fv.name order by count(tb.name) desc limit 10''') + venue = self.env.cr.dictfetchall() + self.env.cr.execute('''select pr.name,count(tb.name) from venue_booking as tb + inner join res_partner as pr on pr.id = tb.partner_id + group by pr.name order by count(tb.name) desc limit 10''') + customer = self.env.cr.dictfetchall() + self.env.cr.execute('''select tb.ref, pr.name, tb.date from + venue_booking as tb + inner join res_partner as pr on pr.id = tb.partner_id + where tb.date >= '%s' and tb.state = 'invoice' + order by tb.date''' % fields.date.today()) + upcoming = self.env.cr.dictfetchall() + return {'venue': venue, 'customer': customer, 'upcoming': upcoming} + + @api.model + def get_booking_analysis(self): + """Function to return customer details to js for graph view""" + self.env.cr.execute('''select pr.name,sum(tb.total) from venue_booking as tb + inner join res_partner as pr on pr.id = tb.partner_id + group by pr.name order by sum(tb.total)''') + booking = self.env.cr.dictfetchall() + count = [] + customer = [] + for record in booking: + customer.append(record.get('name')) + count.append(record.get('sum')) + value = {'name': customer, 'count': count} + return value + + @api.model + def get_venue_analysis(self): + """Function to return truck details to js for graph view""" + self.env.cr.execute('''select fv.name,sum(tb.total) from venue_booking as tb + inner join venue as fv on fv.id = tb.venue_id + group by fv.name order by sum(tb.total)''') + booking = self.env.cr.dictfetchall() + count = [] + customer = [] + for record in booking: + customer.append(record.get('name')) + count.append(record.get('sum')) + return {'name': customer, 'count': count} + + @api.model + def get_select_filter(self, option): + """Function to filter data on the bases of the year""" + if option == 'year': + create_date = '''create_date between (now() - interval '1 year') and now()''' + elif option == 'month': + create_date = '''create_date between (now() - interval '1 months') and now()''' + elif option == 'week': + create_date = '''create_date between (now() - interval '7 day') and now()''' + elif option == 'day': + create_date = '''create_date between (now() - interval '1 day') and now()''' + self.env.cr.execute('''select count(*) from venue_booking + where %s''' % create_date) + booking = self.env.cr.dictfetchall() + self.env.cr.execute('''select sum(total) from venue_booking + where %s''' % create_date) + amount = self.env.cr.dictfetchall() + self.env.cr.execute('''select sum(total) from venue_booking + where state = 'invoice' and %s''' % create_date) + invoice = self.env.cr.dictfetchall() + self.env.cr.execute('''select count(*) from venue + where %s''' % create_date) + venue_count = self.env.cr.dictfetchall() + self.env.cr.execute('''SELECT fv.name, COUNT(tb.name) AS name_count + FROM venue_booking AS tb + INNER JOIN venue AS fv ON fv.id = tb.venue_id + where tb.%s + GROUP BY fv.name + ORDER BY name_count DESC + LIMIT 10''' % create_date) + venue = self.env.cr.dictfetchall() + self.env.cr.execute('''SELECT pr.name, COUNT(tb.name) AS name_count + FROM venue_booking AS tb + INNER JOIN res_partner AS pr ON pr.id = tb.partner_id + where tb.%s + GROUP BY pr.name + ORDER BY name_count DESC + LIMIT 10''' % create_date) + customer = self.env.cr.dictfetchall() + self.env.cr.execute('''SELECT pr.name, COUNT(pr.name) AS count, SUM(tb.total) AS total_sum + FROM venue_booking AS tb + INNER JOIN res_partner AS pr ON pr.id = tb.partner_id + WHERE tb.%s + GROUP BY pr.name + ''' % create_date) + cust_invoice = self.env.cr.dictfetchall() + cust_invoice_name = [] + cust_invoice_sum = [] + cust_invoice_count = [] + for record in cust_invoice: + cust_invoice_name.append(record.get('name')) + cust_invoice_count.append(record.get('count')) + cust_invoice_sum.append(record.get('sum')) + self.env.cr.execute('''SELECT fv.name, SUM(tb.total) AS total_sum + FROM venue_booking AS tb + INNER JOIN venue AS fv ON fv.id = tb.venue_id + where tb.%s + GROUP BY fv.name; + ''' % create_date) + truck_invoice = self.env.cr.dictfetchall() + truck_invoice_name = [] + truck_invoice_sum = [] + for record in truck_invoice: + truck_invoice_name.append(record.get('name')) + truck_invoice_sum.append(record.get('total_sum')) + return {'booking': booking, 'amount': amount, + 'invoice': invoice, 'venue': venue, 'venue_count': venue_count, + 'customer': customer, + 'cust_invoice_name': cust_invoice_name, + 'cust_invoice_count': cust_invoice_count, 'cust_invoice_sum': + cust_invoice_sum, 'truck_invoice_name': truck_invoice_name, + 'truck_invoice_sum': truck_invoice_sum, + } diff --git a/venue_booking_management/models/venue_booking_line.py b/venue_booking_management/models/venue_booking_line.py new file mode 100644 index 000000000..056616339 --- /dev/null +++ b/venue_booking_management/models/venue_booking_line.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 api, fields, models + + +class VenueBookingLine(models.Model): + """Model to manage the Venue Booking lines of the Venue Reservation""" + _name = 'venue.booking.line' + _description = "Venue Booking" + + venue_booking_id = fields.Many2one('venue.booking', + string="Venue Booking", + help='The relation added for the venue ' + 'Booking ') + state = fields.Selection([('done', 'Done'), ('pending', 'Pending')], + string="State", default="pending", + readonly=True, + help="The state of the venue Booking line") + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: + self.env.user.company_id.currency_id, + string="Currency", + help="The currency of the booking line") + is_invoiced = fields.Boolean(string="Invoiced", readonly=True, + help="The boolean value used for finding the " + "venue booking is invoiced or not") + venue_type_id = fields.Many2one('venue.type', + string="Related Venue Type", + related='venue_booking_id.venue_type_id', + help="The venue type of the booking line") + amenity_id = fields.Many2one('amenities', string='Amenities', + help='The relational field for the booking ' + 'line with the amenities model') + quantity = fields.Float(string="Quantity", default=1, + help="Quantity of the Amenities") + amount = fields.Float(string="Amount", help="Amount of the Amenities", + related='amenity_id.amount') + sub_total = fields.Float(string="Sub Total", + compute="_compute_extra_sub_total", + readonly=True, help="Sub Total of the Values") + + @api.depends('quantity', 'amount') + def _compute_extra_sub_total(self): + """Compute function for the Amenities""" + for booking in self: + booking.sub_total = booking.quantity * booking.amount diff --git a/venue_booking_management/models/venue_lines.py b/venue_booking_management/models/venue_lines.py new file mode 100644 index 000000000..a0812ce6f --- /dev/null +++ b/venue_booking_management/models/venue_lines.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 api, fields, models + + +class VenueLines(models.Model): + """Model for managing the Venue lines""" + _name = 'venue.lines' + _description = 'Venue Lines' + + venue_id = fields.Many2one('venue', string='Venue Lines', + help='The relational field for the venue model') + amenities_id = fields.Many2one('amenities', string='Amenities', + help='The field used to link the ' + 'amenities model') + quantity = fields.Float(string="Quantity", default=1, + help="Quantity of the Amenities") + amount = fields.Float(string="Amount", help="Amount of the Amenities", + related='amenities_id.amount') + sub_total = fields.Float(string="Subtotal", compute="_compute_sub_total", + readonly=True, help="Sub Total of the Values") + currency_id = fields.Many2one('res.currency', readonly=True, + string='Currency', + default=lambda self: + self.env.user.company_id.currency_id, + help="Currency value of the Venue") + status = fields.Selection([('open', 'Open'), ('done', 'Done')], + string="Status", default='open', + help="Status of the Venue") + + @api.depends('quantity', 'amount') + def _compute_sub_total(self): + """Compute the Sub Total of the Venue values""" + for item in self: + item.sub_total = item.quantity * item.amount diff --git a/venue_booking_management/models/venue_type.py b/venue_booking_management/models/venue_type.py new file mode 100644 index 000000000..8a594e319 --- /dev/null +++ b/venue_booking_management/models/venue_type.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 VenueType(models.Model): + """Model for managing the Venue types""" + _name = 'venue.type' + _description = 'Venue Type' + + name = fields.Char(string="Name", help="Name of the venue type") + image = fields.Binary(string="Image", attachment=True, + help="This field holds the image used as " + "image for the event, limited to 1080x720px.") diff --git a/venue_booking_management/report/__init__.py b/venue_booking_management/report/__init__.py new file mode 100644 index 000000000..3ffd37d69 --- /dev/null +++ b/venue_booking_management/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 form_venue_booking_report +from . import venue_booking_report diff --git a/venue_booking_management/report/form_venue_booking_report.py b/venue_booking_management/report/form_venue_booking_report.py new file mode 100644 index 000000000..850fc65b6 --- /dev/null +++ b/venue_booking_management/report/form_venue_booking_report.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 . +# +############################################################################### +import pytz + +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class VenueBookingReport(models.AbstractModel): + """Class is used to print pdf report for the venue_booking module + form view""" + _name = 'report.venue_booking_management.report_venue_booking' + + @api.model + def _get_report_values(self, docids, data=None): + """Function to return values for the report, + docids: it will provide the current id the model""" + current = fields.datetime.now().astimezone( + pytz.timezone(self.env.user.tz)) + current = current.strftime("%d-%m-%Y %H:%M:%S") + if docids: + doc_ids = self.env['venue.booking'].sudo().browse(docids) + return { + 'doc_ids': doc_ids, + 'today_date': current, + } + else: + form_data = data['form'] + # Initialize the SQL WHERE clause + where = '1=1' + # Check if the start_date is greater than end_date + if form_data['start_date'] and form_data['end_date'] and form_data[ + 'start_date'] > form_data['end_date']: + raise ValidationError('Start Date must be less than End Date') + # Add conditions to the WHERE clause based on form data + if form_data["partner_id"]: + where += """ AND tb.partner_id = %s""" % \ + form_data['partner_id'][0] + if form_data['start_date']: + where += """ AND tb.date >= '%s'""" % form_data['start_date'] + if form_data['end_date']: + where += """ AND tb.date <= '%s'""" % form_data['end_date'] + if form_data['venue_id']: + where += """ AND tb.venue_id = %s""" % form_data['venue_id'][0] + # Execute the SQL query with the WHERE clause + self.env.cr.execute(""" + SELECT tb.ref, pr.name, fv.name as venue, tb.booking_type, + tb.date, tb.start_date, tb.end_date, tb.state + FROM venue_booking as tb + INNER JOIN res_partner as pr ON pr.id = tb.partner_id + INNER JOIN venue as fv ON fv.id = tb.venue_id + WHERE %s + """ % where) + # Fetch the query results + rec = self.env.cr.dictfetchall() + # Return the data for the report + return { + 'docs': rec, + 'docs2': form_data, + 'today_date': current, + } diff --git a/venue_booking_management/report/venue_booking_report.py b/venue_booking_management/report/venue_booking_report.py new file mode 100644 index 000000000..b061558a2 --- /dev/null +++ b/venue_booking_management/report/venue_booking_report.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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, tools + + +class VenueBookingReport(models.Model): + _name = "venue.booking.report" + _description = "Venue Booking Analysis Report" + _auto = False + _rec_name = 'date' + _order = 'date desc' + + name = fields.Char(string='Booking Reference', readonly=True, + help="Booking Reference field for the Reporting") + date = fields.Datetime(string='Booking Date', readonly=True, + help="Booking Date field for the Reporting") + partner_id = fields.Many2one('res.partner', + string='Customer', readonly=True, + help="Partner ID field for the Reporting") + total = fields.Float(string='Total', readonly=True, + help="Total amount for the Booking Values") + state = fields.Selection([ + ('draft', 'Enquiry'), + ('confirm', 'Confirmed'), + ('invoice', 'Invoiced'), + ('close', 'Closed'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, + help="The selection field for the Booking") + + def init(self): + """Initialize the function to get the Booking Details""" + tools.drop_view_if_exists(self._cr, self._table) + self._cr.execute(""" + CREATE OR REPLACE VIEW %s AS ( + SELECT + vb.id as id, + vb.name as name, + vb.date as date, + vb.partner_id as partner_id, + vb.total as total, + vb.state as state + FROM venue_booking vb + WHERE vb.state IN ('confirm', 'invoice') + GROUP BY + vb.id, + vb.name, + vb.date, + vb.partner_id, + vb.total, + vb.state + ORDER BY vb.id + ) + """ % (self._table,)) diff --git a/venue_booking_management/report/venue_booking_report_templates.xml b/venue_booking_management/report/venue_booking_report_templates.xml new file mode 100644 index 000000000..0c4c6509d --- /dev/null +++ b/venue_booking_management/report/venue_booking_report_templates.xml @@ -0,0 +1,186 @@ + + + + + diff --git a/venue_booking_management/report/venue_booking_report_views.xml b/venue_booking_management/report/venue_booking_report_views.xml new file mode 100644 index 000000000..f58484296 --- /dev/null +++ b/venue_booking_management/report/venue_booking_report_views.xml @@ -0,0 +1,108 @@ + + + + + venue.booking.report.view.pivot + venue.booking.report + + + + + + + + + + + + venue.booking.report.view.graph + venue.booking.report + + + + + + + + + + + venue.booking.report.view.tree + venue.booking.report + + + + + + + + + + + + venue.booking.report.view.search + venue.booking.report + + + + + + + + + + + + + + + + + + + + + + + + Venue Booking Analysis + venue.booking.report + graph,pivot + + {'group_by_no_leaf':1,'group_by':[], + 'search_default_filter_order_date': 1} + + This report performs analysis on your Venue + Booking. + + + + Venue Booking Analysis + venue.booking.report + pivot + + + + + diff --git a/venue_booking_management/report/venue_booking_rerports.xml b/venue_booking_management/report/venue_booking_rerports.xml new file mode 100644 index 000000000..3e8b8cba8 --- /dev/null +++ b/venue_booking_management/report/venue_booking_rerports.xml @@ -0,0 +1,18 @@ + + + + + Venue Booking + venue.booking + qweb-pdf + + venue_booking_management.report_venue_booking + + + venue_booking_management.report_venue_booking + + + report + + diff --git a/venue_booking_management/security/ir.model.access.csv b/venue_booking_management/security/ir.model.access.csv new file mode 100644 index 000000000..9fc24ff71 --- /dev/null +++ b/venue_booking_management/security/ir.model.access.csv @@ -0,0 +1,10 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_venue_type_manager,access.venue.type.manager,model_venue_type,base.group_user,1,1,1,1 +access_venue_booking,access.venue.booking,model_venue_booking,base.group_user,1,1,1,1 +access_amenities,access.amenities,model_amenities,base.group_user,1,1,1,1 +access_venue,access.venue,model_venue,base.group_user,1,1,1,1 +access_venue_lines,access.venue.lines,model_venue_lines,base.group_user,1,1,1,1 +access_venue_booking_line,access.venue.booking.line,model_venue_booking_line,base.group_user,1,1,1,1 +access_check_venue_availability,access.check.venue.availability,model_check_venue_availability,base.group_user,1,1,1,1 +access_venue_booking_report,access.venue.booking.report,model_venue_booking_report,base.group_user,1,1,1,1 +access_venue_booking_analysis,access.venue.booking.analysis,model_venue_booking_analysis,base.group_user,1,1,1,1 diff --git a/venue_booking_management/security/venue_booking_management_groups.xml b/venue_booking_management/security/venue_booking_management_groups.xml new file mode 100644 index 000000000..db391f355 --- /dev/null +++ b/venue_booking_management/security/venue_booking_management_groups.xml @@ -0,0 +1,22 @@ + + + + Venue Booking Management + Category for Venue Booking Management + + + + User + + + + + Manager + + + + + diff --git a/venue_booking_management/security/venue_booking_secruity.xml b/venue_booking_management/security/venue_booking_secruity.xml new file mode 100644 index 000000000..80211c1de --- /dev/null +++ b/venue_booking_management/security/venue_booking_secruity.xml @@ -0,0 +1,22 @@ + + + + + View Own Docs + + ['|',('user_id', '=', + user.id),('create_uid', + '=', user.id)] + + + + + + View All Docs + + [(1, '=', 1)] + + + diff --git a/venue_booking_management/static/description/assets/icons/capture (1).png b/venue_booking_management/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/capture (1).png differ diff --git a/venue_booking_management/static/description/assets/icons/check.png b/venue_booking_management/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/check.png differ diff --git a/venue_booking_management/static/description/assets/icons/chevron.png b/venue_booking_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/chevron.png differ diff --git a/venue_booking_management/static/description/assets/icons/cogs.png b/venue_booking_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/cogs.png differ diff --git a/venue_booking_management/static/description/assets/icons/consultation.png b/venue_booking_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/consultation.png differ diff --git a/venue_booking_management/static/description/assets/icons/ecom-black.png b/venue_booking_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/ecom-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/education-black.png b/venue_booking_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/education-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/hotel-black.png b/venue_booking_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/hotel-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/img.png b/venue_booking_management/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/img.png differ diff --git a/venue_booking_management/static/description/assets/icons/license.png b/venue_booking_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/license.png differ diff --git a/venue_booking_management/static/description/assets/icons/lifebuoy.png b/venue_booking_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/lifebuoy.png differ diff --git a/venue_booking_management/static/description/assets/icons/manufacturing-black.png b/venue_booking_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/photo-capture.png b/venue_booking_management/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/photo-capture.png differ diff --git a/venue_booking_management/static/description/assets/icons/pos-black.png b/venue_booking_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/pos-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/puzzle.png b/venue_booking_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/puzzle.png differ diff --git a/venue_booking_management/static/description/assets/icons/restaurant-black.png b/venue_booking_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/restaurant-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/service-black.png b/venue_booking_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/service-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/trading-black.png b/venue_booking_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/trading-black.png differ diff --git a/venue_booking_management/static/description/assets/icons/training.png b/venue_booking_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/training.png differ diff --git a/venue_booking_management/static/description/assets/icons/update.png b/venue_booking_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/update.png differ diff --git a/venue_booking_management/static/description/assets/icons/user.png b/venue_booking_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/user.png differ diff --git a/venue_booking_management/static/description/assets/icons/wrench.png b/venue_booking_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/venue_booking_management/static/description/assets/icons/wrench.png differ diff --git a/venue_booking_management/static/description/assets/misc/Cybrosys R.png b/venue_booking_management/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/venue_booking_management/static/description/assets/misc/Cybrosys R.png differ diff --git a/venue_booking_management/static/description/assets/misc/email.svg b/venue_booking_management/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/phone.svg b/venue_booking_management/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/venue_booking_management/static/description/assets/misc/star (1) 2.svg b/venue_booking_management/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/support (1) 1.svg b/venue_booking_management/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/support-email.svg b/venue_booking_management/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/tick-mark.svg b/venue_booking_management/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/whatsapp 1.svg b/venue_booking_management/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/misc/whatsapp.svg b/venue_booking_management/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/venue_booking_management/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/venue_booking_management/static/description/assets/modules/1.png b/venue_booking_management/static/description/assets/modules/1.png new file mode 100644 index 000000000..ae33208db Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/1.png differ diff --git a/venue_booking_management/static/description/assets/modules/2.jpg b/venue_booking_management/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..73781cf50 Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/2.jpg differ diff --git a/venue_booking_management/static/description/assets/modules/3.gif b/venue_booking_management/static/description/assets/modules/3.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/3.gif differ diff --git a/venue_booking_management/static/description/assets/modules/4.gif b/venue_booking_management/static/description/assets/modules/4.gif new file mode 100644 index 000000000..8ac32db03 Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/4.gif differ diff --git a/venue_booking_management/static/description/assets/modules/5.jpg b/venue_booking_management/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/5.jpg differ diff --git a/venue_booking_management/static/description/assets/modules/6.jpg b/venue_booking_management/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..87c2bb2ba Binary files /dev/null and b/venue_booking_management/static/description/assets/modules/6.jpg differ diff --git a/venue_booking_management/static/description/assets/screenshots/1.png b/venue_booking_management/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6aed3bca9 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/1.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/10.png b/venue_booking_management/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..daa218587 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/10.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/11.png b/venue_booking_management/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..b4852816d Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/11.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/12.png b/venue_booking_management/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..d23af4084 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/12.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/13.png b/venue_booking_management/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..ddc5e7179 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/13.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/14.png b/venue_booking_management/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..d31388599 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/14.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/15.png b/venue_booking_management/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..633fdfb4f Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/15.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/16.png b/venue_booking_management/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..9b0d7b8d9 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/16.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/17.png b/venue_booking_management/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..9b79256ac Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/17.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/18.png b/venue_booking_management/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..90458b1a8 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/18.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/19.png b/venue_booking_management/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..e7be36cd1 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/19.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/2.png b/venue_booking_management/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..b87a6c29e Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/2.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/20.png b/venue_booking_management/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..c0b945811 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/20.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/21.png b/venue_booking_management/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..7cdf6bc53 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/21.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/22.png b/venue_booking_management/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..d7936b879 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/22.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/23.png b/venue_booking_management/static/description/assets/screenshots/23.png new file mode 100644 index 000000000..ba642210e Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/23.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/24.png b/venue_booking_management/static/description/assets/screenshots/24.png new file mode 100644 index 000000000..c40b16a8b Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/24.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/25.png b/venue_booking_management/static/description/assets/screenshots/25.png new file mode 100644 index 000000000..d829300df Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/25.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/26.png b/venue_booking_management/static/description/assets/screenshots/26.png new file mode 100644 index 000000000..3ce70c244 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/26.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/27.png b/venue_booking_management/static/description/assets/screenshots/27.png new file mode 100644 index 000000000..7a863d78f Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/27.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/28.png b/venue_booking_management/static/description/assets/screenshots/28.png new file mode 100644 index 000000000..3337f32cc Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/28.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/29.png b/venue_booking_management/static/description/assets/screenshots/29.png new file mode 100644 index 000000000..943ba2f0d Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/29.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/3.png b/venue_booking_management/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..2c21411b8 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/3.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/30.png b/venue_booking_management/static/description/assets/screenshots/30.png new file mode 100644 index 000000000..093dc1bdd Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/30.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/31.png b/venue_booking_management/static/description/assets/screenshots/31.png new file mode 100644 index 000000000..e06883a12 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/31.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/32.png b/venue_booking_management/static/description/assets/screenshots/32.png new file mode 100644 index 000000000..6bdf1c382 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/32.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/33.png b/venue_booking_management/static/description/assets/screenshots/33.png new file mode 100644 index 000000000..0c98ccf9c Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/33.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/34.png b/venue_booking_management/static/description/assets/screenshots/34.png new file mode 100644 index 000000000..4185dc65a Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/34.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/35.png b/venue_booking_management/static/description/assets/screenshots/35.png new file mode 100644 index 000000000..1a263f5f1 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/35.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/36.png b/venue_booking_management/static/description/assets/screenshots/36.png new file mode 100644 index 000000000..458094d96 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/36.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/37.png b/venue_booking_management/static/description/assets/screenshots/37.png new file mode 100644 index 000000000..e97900538 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/37.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/38.png b/venue_booking_management/static/description/assets/screenshots/38.png new file mode 100644 index 000000000..407151616 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/38.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/39.png b/venue_booking_management/static/description/assets/screenshots/39.png new file mode 100644 index 000000000..ca4df99e0 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/39.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/4.png b/venue_booking_management/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..dc8564c89 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/4.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/40.png b/venue_booking_management/static/description/assets/screenshots/40.png new file mode 100644 index 000000000..5f3ca0227 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/40.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/41.png b/venue_booking_management/static/description/assets/screenshots/41.png new file mode 100644 index 000000000..4330e7c4c Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/41.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/42.png b/venue_booking_management/static/description/assets/screenshots/42.png new file mode 100644 index 000000000..467c4c283 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/42.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/43.png b/venue_booking_management/static/description/assets/screenshots/43.png new file mode 100644 index 000000000..995371673 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/43.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/44.png b/venue_booking_management/static/description/assets/screenshots/44.png new file mode 100644 index 000000000..4cab42aa6 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/44.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/5.png b/venue_booking_management/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..abee6ad4a Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/5.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/6.png b/venue_booking_management/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..873d8c42f Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/6.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/7.png b/venue_booking_management/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..9b481cf3d Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/7.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/8.png b/venue_booking_management/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..14685bb14 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/8.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/9.png b/venue_booking_management/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..c05c83ec2 Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/9.png differ diff --git a/venue_booking_management/static/description/assets/screenshots/hero.gif b/venue_booking_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..82d13154c Binary files /dev/null and b/venue_booking_management/static/description/assets/screenshots/hero.gif differ diff --git a/venue_booking_management/static/description/banner.jpg b/venue_booking_management/static/description/banner.jpg new file mode 100644 index 000000000..0415e22dd Binary files /dev/null and b/venue_booking_management/static/description/banner.jpg differ diff --git a/venue_booking_management/static/description/icon.png b/venue_booking_management/static/description/icon.png new file mode 100644 index 000000000..36ac6a3cc Binary files /dev/null and b/venue_booking_management/static/description/icon.png differ diff --git a/venue_booking_management/static/description/index.html b/venue_booking_management/static/description/index.html new file mode 100644 index 000000000..402ca63c3 --- /dev/null +++ b/venue_booking_management/static/description/index.html @@ -0,0 +1,1470 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +

+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Venue / Event Booking Management

+

+ Managing Different Types of Venue/ Event Booking. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Venue Booking

+

Can create new Venue Booking orders. +

+
+
+
+
+
+
+ +
+
+

+ Provide Different types of Venue and Amenities

+

+ Amenities help to add Extra features to your Venue. +

+
+
+
+
+
+
+ +
+
+

+ Integrated with Accounting Module

+

Can create and view invoices based on the Venue Booking. +

+
+
+
+
+
+
+ +
+
+

+ Informative Dashboard with Kanban Representation and the Graphical View

+

Venue related order count is visible and can see the Booking related to each Venue type on clicking the type from Dashboard. Also gives the top level venue, customer information and the Booking information with the Dashboard. +

+
+
+
+
+
+
+ +
+
+

+ Venue Types and Amenities

+

User can configure new Venue types and can delete the old ones. Can configure types from the Dashboard itself. Feasible to add Amenities in their Particular Venue. +

+
+
+
+
+
+
+ +
+
+

+ Reports

+

The Venue Booking Management Report Will gives the Analysis Reporting, the Pdf and Xlsx Reporting. +

+
+
+
+
+
+
+ +
+
+

+ Venue Booking can manage Extra Amounts of Venues

+

It handles Additional cost and Service charges. +

+
+
+
+
+
+
+ +
+
+

+ Website Booking can manage

+

It handles website Venue booking the new customer can easily book their venue on time. +

+
+
+
+
+
+
+ +
+
+

+ Portal View for the Booking Details Available based on the User

+

It handles Portal view of the logged person Records. +

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

+ Dashboard view with all the Venue Details and venue types and related order counts.

+
+
+
+
+
+
+ +
+
+

+ Venue Booking Kanban Board Dashboard type with the Venue and Details.

+
+
+
+
+
+
+ +
+
+

+ Kanban View with Venue Image and Venue Reference.

+
+
+
+
+
+
+ +
+
+

+ We can set the Venue Booking Manager and User from the Settings --> Users & Companies --> Users .

+
+
+
+
+
+
+ +
+
+

+ After setup by Manager and User they can see the Venue Booking Menu.

+
+
+
+
+
+
+ +
+
+

+ Configuration Settings Option for the App.

+
+
+
+
+
+
+ +
+
+

+ If you have any Extra Amount you can add in Extra Amount field.

+
+
+
+
+
+
+ +
+
+

+ Enabling the Add Extra Charge? on Venue Booking.

+
+
+
+
+
+
+ +
+
+

+ Extra Charge will be added in the Invoice Lines.

+
+
+
+
+
+
+ +
+
+

+ Under the Configuration menu we can choose the Venue Type.

+
+
+
+
+
+
+ +
+
+

+ Under the Configuration menu we can choose the Amenities.

+
+
+
+
+
+
+ +
+
+

+ Under the Configuration menu we can choose the Customer.

+
+
+
+
+
+
+ +
+
+

+ We can create the Venue based on the Types and Amenities.

+
+
+
+
+
+
+ +
+
+

+ Venue form view

+
+
+
+
+
+
+ +
+
+

+ We can create the Venue Booking Under the Venue Booking Menu.

+
+
+
+
+
+
+ +
+
+

+ Validation Message will be pop-up the Venue Booking while select already added Amenities.

+
+
+
+
+
+
+ +
+
+

+ Confirming the Venue Booking.

+
+
+
+
+
+
+ +
+
+

+ Create Invoice,Send Mail,Reset to Draft buttons are available in the Venue Booking Confirmed State.

+
+
+
+
+
+
+ +
+
+

+ Send Mail button in the Confirmed state of the Venue Booking.

+
+
+
+
+
+
+ +
+
+

+ Create Invoice under the Confirmed state of the Venue Booking.

+
+
+
+
+
+
+ +
+
+

+ Invoice created with Charges and Amenities.

+
+
+
+
+
+
+ +
+
+

+ Stage changed to Invoiced and the Smart Button will show the Invoice Records.

+
+
+
+
+
+
+ +
+
+

+ Reset tO Draft Button helps to set the Records into Draft state.

+
+
+
+
+
+
+ +
+
+

+ It will generate a Validation Error when selecting a date that is already selected in the date field.

+
+
+
+
+
+
+ +
+
+

+ Booking Request Menus are available under the Venue Booking Menu.

+
+
+
+
+
+
+ +
+
+

+ Confirmed Bookings Menus are available under the Venue Booking Menu.

+
+
+
+
+
+
+ +
+
+

+ The Check Venue Availability menu redirect to a wizard that helps to find the Venue Availability.

+
+
+
+
+
+
+ +
+
+

+ When Venues are not available on selected date at the time click on 'Search' Button got a Validation Error.

+
+
+
+
+
+
+ +
+
+

+ When Venues are not available on specified Budget at the time click on 'Search' Button got a Validation Error.

+
+
+
+
+
+
+ +
+
+

+ When Venues are not available on specified Capacity at the time click on 'Search' Button got a Validation Error.

+
+
+
+
+
+
+ +
+
+

+ Click on 'Search' Button after adding your condition.

+
+
+
+
+
+
+ +
+
+

+ The Booking page will be filled with the mentioned details.

+
+
+
+
+
+
+ +
+
+

+ Analysis Report for the Venue Booking, that contains the Pivot view and the Graph view .

+
+
+
+
+
+
+ +
+
+

+ The Venue Booking Analysis Report will generate a wizard action that help to print the Reports.Can print pdf and xlsx report with the help of PRINT PDF and PRINT XLSX buttons.

+
+
+
+
+
+
+ +
+
+

+ PDF report with the Booking details based on the details from Report wizard.

+
+
+
+
+
+
+ +
+
+

+ Excel report with the Booking details based on the details from Report wizard.

+
+
+
+
+
+
+ +
+
+

+ The Venue Booking menu in the website redirect to the booking templates page.

+
+
+
+
+
+
+ +
+
+

+ When you click 'Next' button you get option to fill Name, City, State, Country and Mobile Number.

+
+
+
+
+
+
+ +
+
+

+ Submitting the Venue Booking with the mentioned details it will be automatically redirect to the Success Page.

+
+
+
+
+
+
+ +
+
+

+ The Venue Booking displayed in the customer portal page.

+
+
+
+
+
+
+ +
+
+

+ The Venue Booking details displayed in the customer portal page with the Filters and Groups.

+
+
+
+
+
+
+ +
+
+

+ While click on the reference no that will redirect the Booking details Page.

+
+
+
+
+
+
+
    +
  • + Multiple Reference Per Product +
  • +
  • + Effortlessly manage between different reference codes +
  • +
  • + Multiple Reference Code +
      +
    • +
    • +
    +
  • +
  • + Manage Easily +
      +
    • +
    • +
    +
  • +
  • + Default Code +
      +
    • +
    • +
    +
  • +
  • + Easy Search +
      +
    • +
    • +
    +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:23rd Jan 2024 +
+

+ + Initial Commit for Venue / Event Booking Management.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/venue_booking_management/static/img/venue_booking.jpeg b/venue_booking_management/static/img/venue_booking.jpeg new file mode 100644 index 000000000..53b05448e Binary files /dev/null and b/venue_booking_management/static/img/venue_booking.jpeg differ diff --git a/venue_booking_management/static/img/venue_type1.jpeg b/venue_booking_management/static/img/venue_type1.jpeg new file mode 100644 index 000000000..777a7eeba Binary files /dev/null and b/venue_booking_management/static/img/venue_type1.jpeg differ diff --git a/venue_booking_management/static/img/venue_type2.jpeg b/venue_booking_management/static/img/venue_type2.jpeg new file mode 100644 index 000000000..686b70056 Binary files /dev/null and b/venue_booking_management/static/img/venue_type2.jpeg differ diff --git a/venue_booking_management/static/img/venue_type3.jpeg b/venue_booking_management/static/img/venue_type3.jpeg new file mode 100644 index 000000000..9b90428e4 Binary files /dev/null and b/venue_booking_management/static/img/venue_type3.jpeg differ diff --git a/venue_booking_management/static/img/venue_type4.jpeg b/venue_booking_management/static/img/venue_type4.jpeg new file mode 100644 index 000000000..3f9d9d953 Binary files /dev/null and b/venue_booking_management/static/img/venue_type4.jpeg differ diff --git a/venue_booking_management/static/img/venue_type5.jpeg b/venue_booking_management/static/img/venue_type5.jpeg new file mode 100644 index 000000000..e60d88943 Binary files /dev/null and b/venue_booking_management/static/img/venue_type5.jpeg differ diff --git a/venue_booking_management/static/img/venue_type6.jpeg b/venue_booking_management/static/img/venue_type6.jpeg new file mode 100644 index 000000000..c63d5de66 Binary files /dev/null and b/venue_booking_management/static/img/venue_type6.jpeg differ diff --git a/venue_booking_management/static/img/venue_type7.jpeg b/venue_booking_management/static/img/venue_type7.jpeg new file mode 100644 index 000000000..3f0eb7a65 Binary files /dev/null and b/venue_booking_management/static/img/venue_type7.jpeg differ diff --git a/venue_booking_management/static/img/venue_type8.jpeg b/venue_booking_management/static/img/venue_type8.jpeg new file mode 100644 index 000000000..7938771a7 Binary files /dev/null and b/venue_booking_management/static/img/venue_type8.jpeg differ diff --git a/venue_booking_management/static/img/venue_type9.jpeg b/venue_booking_management/static/img/venue_type9.jpeg new file mode 100644 index 000000000..f459c6f50 Binary files /dev/null and b/venue_booking_management/static/img/venue_type9.jpeg differ diff --git a/venue_booking_management/static/src/css/venue_dashboard.css b/venue_booking_management/static/src/css/venue_dashboard.css new file mode 100644 index 000000000..3955caa51 --- /dev/null +++ b/venue_booking_management/static/src/css/venue_dashboard.css @@ -0,0 +1,101 @@ +.style_event { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} +.style_event_type { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} +.o_action_manager { + overflow: auto !important; +} +.help_dashboards { + padding-top: 10px; + background-color: #f8faff !important; +} +.dashboard_card h4 { +font-size: 21px; +} +.main-section { + margin-left: 6px; +} +.breadcrumbs { + margin-top: 0; +} +/* Widget One +---------------------------*/ +.stat-content { + display: inline-block; + width: 66%; +} +.stat-icon { + display: inline-block; +} +.stat-widget-one .stat-icon { + vertical-align: top; + margin: auto; + width: 100%; + color: #01c490; +} +.stat-widget-one .stat-text { + font-size: 11px; + color: #868e96; + font-weight: bold; +} +.stat-widget-one .stat-digit { + font-size: 24px; + color: #02448b; +} +/*=====================Dashboard===========================*/ +.customer{ +margin-top: 15px; +backgroud: #fff; +transition: transform 0.2s ease, box-shadow 0.2s ease; +will-change: transform, box-shadow; +box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); +height: 316px; +overflow-y: auto; +margin-bottom: 15px; +border-radius:10px; +} +.customer_head{ +font-size: 17px; +padding: 12px; +color: #7d7eaf; +background-color: #e5e5ef; +} +.padding{ +margin-bottom:75px; +} +.graph{ +padding: 10px; +box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); +background: #fff; +margin-bottom: 15px; +border-radius:15px; +} +.left{ + margin-top: -740px; + margin-left: 800px; +} +.circle{ +border-radius: 50%; +border-color:#fff; + padding: 10px; + color: #7d7eaf; + background-color: #e5e5ef; + font: 20px arial, sans-serif; + height: 44px; + width: 44px; + text-align:center; + margin:auto; +} +.head{ +font-size: 18px; +color: #7d7eaf; +font-family: cursive; +} diff --git a/venue_booking_management/static/src/css/website_page.css b/venue_booking_management/static/src/css/website_page.css new file mode 100644 index 000000000..e15a87995 --- /dev/null +++ b/venue_booking_management/static/src/css/website_page.css @@ -0,0 +1,86 @@ +.head{ +margin-top:25px; +margin-left:20px; +} +.image{ +background-image:url("/venue_booking_management/static/img/venue_booking.jpeg"); +background-size:cover; +height:300px; +width:300px; +margin-left:-20px; +} +h1{ +color:gray; +font-family:"Lucida consol","Courier Nem",monospace; +} +.body{ +margin-top:-365px; +margin-left:875px; +margin-bottom:10px; +} +.select{ +position:relative; +} +.link-style{ +width:500px; +height:50px; +border-color:#ed8115; +} +.button{ +width:500px; +height:50px; +background-color:#ed8115; +color:white; +border-color:#ed8115; +} +.input{ +width:500px; +height:50px; +border-color:#ed8115; +} +.success{ +font-size:20px; +color:white; +text-align:center; +background-color:#ed8115; +height:75px; +padding:15px; +margin-bottom:10px; +} +.link{ +color:#ed8115; +} +.form-group{ +padding-bottom:10px; +padding-top:10px; +} +.wrap{ +min-height: 450px; +overflow:auto; +} +@media(max-width:790px){ +.head{ +margin-top:15px; +margin-left:11px; +} +.image{ +height:190px; +width:360px; +margin-left:-21px; +} +.body{ +margin-top:25px; +margin-left:2px; +} +.input{ +width:332px; +} +.button{ +width:332px; +} +.link-style{ +width:332px; +} +.unit{ +right:-7px; +} diff --git a/venue_booking_management/static/src/js/action_manager.js b/venue_booking_management/static/src/js/action_manager.js new file mode 100644 index 000000000..b056fc712 --- /dev/null +++ b/venue_booking_management/static/src/js/action_manager.js @@ -0,0 +1,16 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { download } from "@web/core/network/download"; +import { BlockUI } from "@web/core/ui/block_ui"; +// This function is responsible for generating and downloading an XLSX report. +registry.category("ir.actions.report handlers").add("xlsx_handler", async (action) => { + if (action.report_type === 'xlsx') { + const blockUI = new BlockUI(); + await download({ + url: '/venue_xlsx_reports', + data: action.data, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + } +}); diff --git a/venue_booking_management/static/src/js/dashboard_action.js b/venue_booking_management/static/src/js/dashboard_action.js new file mode 100644 index 000000000..a3fe45ae0 --- /dev/null +++ b/venue_booking_management/static/src/js/dashboard_action.js @@ -0,0 +1,329 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { onWillStart, onMounted, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +const actionRegistry = registry.category("actions"); +import { _t } from "@web/core/l10n/translation"; +var op_type; +/* This class represents dashboard in Inventory. */ +class CustomDashBoard extends owl.Component { + setup() { + this.orm = useService('orm') + this.rootRef = useRef('root') + // When the component is about to start, fetch data in tiles + onWillStart(async () => { + var self = this; + this.props.title = 'Dashboard'; + var total_count = this.orm.call('venue.booking', 'get_total_booking') + .then(function(result) { + self.props.booking_count = result.total_booking + self.props.total_venue = result.total_venue + self.props.total_amount = result.total_amount + self.props.total_invoice = result.total_invoice + }) + var table_content = this.orm.call('venue.booking', 'get_top_venue') + .then(function(result) { + self.props.upcoming = result.upcoming + self.props.venue = result.venue + self.props.customer = result.customer + }) + return $.when(total_count, table_content) + }); + // When the component is mounted, render various charts + onMounted(async () => { + this.render_booking(); + this.render_venue(); + }); + } + //Function for render booking graph + render_booking() { + var self = this + var ctx = $("#booking"); + this.orm.call('venue.booking', 'get_select_filter', [$("#stock_selection").val()]) + .then(function(result) { + var data = { + labels: result.cust_invoice_name, + datasets: [{ + label: 'Count', + data: result.cust_invoice_count, + backgroundColor: [ + "#003f5c", + "#2f4b7c", + "#f95d6a", + "#665191", + "#d45087", + "#ff7c43", + "#ffa600", + "#a05195", + "#6d5c16" + ], + borderColor: [ + "#003f5c", + "#2f4b7c", + "#f95d6a", + "#665191", + "#d45087", + "#ff7c43", + "#ffa600", + "#a05195", + "#6d5c16" + ], + barPercentage: 0.5, + barThickness: 6, + maxBarThickness: 8, + minBarLength: 0, + borderWidth: 1, + fill: false + }, ] + }; + var options = { + responsive: true, + scales: { + y: { + beginAtZero: true + } + }, + }; + //create Chart class object + var chart = new Chart(ctx, { + type: "bar", + data: data, + options: options + }); + }); + } + //Function for render venue graph + render_venue() { + var self = this + var ctx = $("#venue"); + this.orm.call('venue.booking', 'get_select_filter', [$("#stock_selection").val()]) + .then(function(result) { + var data = { + labels: result.truck_invoice_name, + datasets: [{ + label: 'Count', + data: result.truck_invoice_sum, + backgroundColor: [ + "#665191", + "#ff7c43", + "#ffa600", + "#d45087", + "#a05195", + "#6d5c16", + "#CCCCFF", + "#003f5c", + "#2f4b7c", + "#f95d6a", + ], + borderColor: [ + "#003f5c", + "#2f4b7c", + "#f95d6a", + "#665191", + "#d45087", + "#ff7c43", + "#ffa600", + "#a05195", + "#6d5c16", + "#CCCCFF" + ], + barPercentage: 0.5, + barThickness: 6, + maxBarThickness: 8, + minBarLength: 0, + borderWidth: 1, + fill: false + }, ] + }; + + var options = { + responsive: true, + scales: { + y: { + beginAtZero: true + } + }, + }; + //create Chart class object + var chart = new Chart(ctx, { + type: "pie", + data: data, + options: options + }); + }); + } + //Function for filter the dashboard content + on_change_booking_values(e) { + e.stopPropagation(); + var $target = $(e.target); + var value = $target.val(); + if (value == "year") { + this.onclick_this_year($target.val()); + } else if (value == "quarter") { + this.onclick_this_quarter($target.val()); + } else if (value == "month") { + this.onclick_this_month($target.val()); + } else if (value == "week") { + this.onclick_this_week($target.val()); + } + } + //Function for monthly filter on dashboard content + onclick_this_month(ev) { + self = this; + this.orm.call('venue.booking', 'get_select_filter', [ev]) + .then(function(result) { + $('.total').hide(); + $('#booking_this_year').hide(); + $('#distance_this_year').hide(); + $('#amount_this_year').hide(); + $('#invoice_this_year').hide(); + $('#booking_this_day').hide(); + $('#distance_this_day').hide(); + $('#amount_this_day').hide(); + $('#invoice_this_day').hide(); + $('#booking_this_week').hide(); + $('#distance_this_week').hide(); + $('#amount_this_week').hide(); + $('#invoice_this_week').hide(); + $('#booking_this_month').show(); + $('#distance_this_month').show(); + $('#amount_this_month').show(); + $('#invoice_this_month').show(); + $('#booking_this_month').empty(); + $('#amount_this_month').empty(); + $('#invoice_this_month').empty(); + $('#booking_this_month').append('' + result['booking'][0]['count'] + ''); + $('#distance_this_month').append('' + result['venue_count'][0]['count'] + ''); + if (result['amount'][0].sum) { + $('#amount_this_month').append('' + result['amount'][0].sum + ''); + } else { + $('#amount_this_month').append('' + 0 + ''); + } + if (result['invoice'][0].sum) { + $('#invoice_this_month').append('' + result['invoice'][0].sum + ''); + } else { + $('#invoice_this_month').append('' + 0 + '') + } + }) + } + //Function for yearly filter on dashboard content + onclick_this_year(ev) { + self = this; + this.orm.call('venue.booking', 'get_select_filter', [ev]) + .then(function(result) { + $('#booking_this_day').hide(); + $('#distance_this_day').hide(); + $('#amount_this_day').hide(); + $('#invoice_this_day').hide(); + $('#booking_this_month').hide(); + $('#distance_this_month').hide(); + $('#amount_this_month').hide(); + $('#invoice_this_month').hide(); + $('#booking_this_week').hide(); + $('#distance_this_week').hide(); + $('#amount_this_week').hide(); + $('#invoice_this_week').hide(); + $('.total').hide(); + $('#booking_this_year').show(); + $('#distance_this_year').show(); + $('#amount_this_year').show(); + $('#invoice_this_year').show(); + $('#booking_this_year').empty(); + $('#amount_this_year').empty(); + $('#invoice_this_year').empty(); + $('#venue_this_year').empty(); + $('#booking_this_year').append('' + result['booking'][0]['count'] + ''); + $('#venue_this_year').append('' + result['venue_count'][0]['count'] + ''); + if (result['amount'][0].sum) { + $('#amount_this_year').append('' + result['amount'][0].sum + ''); + } else { + $('#amount_this_year').append('' + 0 + ''); + } + if (result['invoice'][0].sum) { + $('#invoice_this_year').append('' + result['invoice'][0].sum + ''); + } else { + $('#invoice_this_year').append('' + 0 + '') + } + }) + } + //Function for daily filter on dashboard content + onclick_this_day(ev) { + self = this; + this.orm.call('venue.booking', 'get_select_filter', [ev]) + .then(function(result) { + $('.total').hide(); + $('#booking_this_month').hide(); + $('#distance_this_month').hide(); + $('#amount_this_month').hide(); + $('#invoice_this_month').hide(); + $('#booking_this_week').hide(); + $('#distance_this_week').hide(); + $('#amount_this_week').hide(); + $('#invoice_this_week').hide(); + $('#booking_this_year').hide(); + $('#distance_this_year').hide(); + $('#amount_this_year').hide(); + $('#invoice_this_year').hide(); + $('#booking_this_day').show(); + $('#amount_this_day').show(); + $('#invoice_this_day').show(); + $('#booking_this_day').empty(); + $('#amount_this_day').empty(); + $('#invoice_this_day').empty(); + $('#venue_this_day').empty(); + $('#booking_this_day').append('' + result['booking'][0]['count'] + ''); + $('#venue_this_day').append('' + result['venue_count'][0]['count'] + ''); + if (result['amount'][0].sum) { + $('#amount_this_day').append('' + result['amount'][0].sum + ''); + } else { + $('#amount_this_day').append('' + 0 + ''); + } + if (result['invoice'][0].sum) { + $('#invoice_this_day').append('' + result['invoice'][0].sum + ''); + } else { + $('#invoice_this_day').append('' + 0 + '') + } + }) + } + //Function for weekly filter on dashboard content + onclick_this_week(ev) { + self = this; + this.orm.call('venue.booking', 'get_select_filter', [ev]) + .then(function(result) { + $('.total').hide(); + $('#booking_this_month').hide(); + $('#distance_this_month').hide(); + $('#amount_this_month').hide(); + $('#invoice_this_month').hide(); + $('#booking_this_year').hide(); + $('#distance_this_year').hide(); + $('#amount_this_year').hide(); + $('#invoice_this_year').hide(); + $('#booking_this_day').hide(); + $('#distance_this_day').hide(); + $('#amount_this_day').hide(); + $('#invoice_this_day').hide(); + $('#booking_this_week').show(); + $('#amount_this_week').show(); + $('#invoice_this_week').show(); + $('#booking_this_week').empty(); + $('#amount_this_week').empty(); + $('#invoice_this_week').empty(); + $('#venue_this_week').empty(); + $('#booking_this_week').append('' + result['booking'][0].count + ''); + $('#venue_this_week').append('' + result['venue_count'][0].count + ''); + if (result['amount'][0].sum) { + $('#amount_this_week').append('' + result['amount'][0].sum + ''); + } else { + $('#amount_this_week').append('' + 0 + ''); + } + if (result['invoice'][0].sum) { + $('#invoice_this_week').append('' + result['invoice'][0].sum + ''); + } else { + $('#invoice_this_week').append('' + 0 + '') + } + }) + } +} +CustomDashBoard.template = "CustomDashBoard"; +actionRegistry.add('dashboard_tags', CustomDashBoard); diff --git a/venue_booking_management/static/src/js/website_venue_booking.js b/venue_booking_management/static/src/js/website_venue_booking.js new file mode 100644 index 000000000..5529fb34a --- /dev/null +++ b/venue_booking_management/static/src/js/website_venue_booking.js @@ -0,0 +1,99 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { _t } from "@web/core/l10n/translation"; + + +publicWidget.registry.websiteLimit = publicWidget.Widget.extend({ + selector: '.venue-booking-widget', + events: { + 'click #check': '_onCheckClick', + 'click #next': '_onNextClick', + 'change #venue_type': '_onChangeVenue', + }, + init() { + this._super(...arguments); + this.orm = this.bindService("orm"); + }, + _onCheckClick: function(ev) { //Click function to fetch from and to location value and calculate the distance. + var self = this + var location = this.el.querySelector('#location').value + if (location != '') { + this.el.querySelector('#loader').classList.remove("d-none"); + ajax.jsonRpc('/geo/' + location, 'call', {}).then(function(data) { // success callback + self.el.querySelector('#loader').classList.add("d-none"); + self.el.querySelector('#details').classList.remove("d-none"); + }).catch(function(data) { + self.el.querySelector('#loader').classList.add("d-none"); + Dialog.alert(this, "Please enter valid city"); + return false; + }); + } else { + Dialog.alert(this, "Add a City"); + return false; + } + }, + _onNextClick: function(ev) { //Function to show the customer details form view + var self = this; + var start_date = self.$el.find('#from_date').val(); + var end_date = self.$el.find('#to_date').val(); + var venue_type = self.$el.find('#venue_type').val(); + var domain = [ + ['start_date', '<', end_date], + ['end_date', '>', start_date], + ['venue_id', '=', venue_type], + ]; + this.orm.call('venue.booking', 'search', [domain]) + .then(function(result) { + if (result) { + const open_deactivate_modal = true; + const modalHTML = ` + + `; + $("body").append(modalHTML); + $("body").find("#popup_error_message").find(".btn-close").on("click", function() { + $("body").find("#popup_error_message").remove(); + }); + } else { + this.el.querySelector('#customer').classList.remove("d-none"); + } + }); + }, + _onChangeVenue: function(event) { //Function for getting popup message for date + var self = this; + var start_date = self.$el.find('#from_date').val(); + var end_date = self.$el.find('#to_date').val(); + if (start_date > end_date) { + event.preventDefault(); + const open_deactivate_modal = true; + const modalHTML = ` + + `; + $("body").append(modalHTML); + $("body").find("#popup_error_message").find(".btn-close").on("click", function() { + $("body").find("#popup_error_message").remove(); + }); + } + }, +}) diff --git a/venue_booking_management/static/src/scss/venue_booking.scss b/venue_booking_management/static/src/scss/venue_booking.scss new file mode 100644 index 000000000..e2b018ec7 --- /dev/null +++ b/venue_booking_management/static/src/scss/venue_booking.scss @@ -0,0 +1,237 @@ +:root { + /* Primary */ + --mauve: #7D7EAF; + --pink-dark: #BD85BA; + --pink: #F78EAD; + --peach: #FFA48E; + --orange: #FFCA71; + --gold: #CEA716; + --green: #1EC198; + --grey: #a0a0a0; + /* Light */ + --mauve-light: #e5e5ef; + --pink-dark-light: #f2e7f1; + --pink-light: #fde8ef; + --peach-light: #ffede8; + --orange-light: #fff4e3; + --gold-light: #faf6e8; + --green-light: #e9f9f5; + --grey-light: #e0e0e0; + + /*Lighter*/ + --grey-lighter: #fafafa; + --grey-dark-lighter: #f3f3f3; +} + +/* Background */ +.bg-mauve-light { + background-color: var(--mauve-light); +} + +.bg-pink-dark-light { + background-color: var(--pink-dark-light); +} + +.bg-pink-light { + background-color: var(--pink-light); +} + +.bg-peach-light { + background-color: var(--peach-light); +} + +.bg-orange-light { + background-color: var(--orange-light); +} + +.bg-gold-light { + background-color: var(--gold-light); +} + +.bg-green-light { + background-color: var(--green-light); +} + +/* Text */ +.text-mauve { + color: var(--mauve); +} + +.text-pink-dark { + color: var(--pink-dark); +} + +.text-pink { + color: var(--pink); +} + +.text-peach { + color: var(--peach); +} + +.text-orange { + color: var(--orange); +} + +.text-gold { + color: var(--gold); +} + +.text-green { + color: var(--green); +} + +/* Cards */ + +.dashboard-card { + border-radius: 0.3rem; + display: flex; + justify-content: center; + padding: 1.7rem 1.5rem 1.5rem 1.5rem; + margin: 1rem auto; + height: 90px; +} + +.dashboard-card__icon-container { + height: 50px; + width: 50px; + border-radius: 50%; +} + +.dashboard-card__icon-container i { + font-size: 20px; +} + +.dashboard-card__details { + margin-left: 1rem; + max-width: 120px; +} + +.dashboard-card__details h3 { + font-weight: 700; + font-size: 1.5rem; +} + +.dashboard-card__details h4 { + font-weight: 700; + font-size: 0.7rem; + color: var(--grey); + margin-top: -5px; +} + +h2.section-header { + font-weight: 700; + font-size: 1.5rem; +} + +.chart-container { + border-radius: 0.3rem; + padding: 1rem; + margin: 1rem auto; +} + +.chart-container.card-shadow { + height: 100%; +} + +.half_chart.chart-container.card-shadow { + height: 49%; +} + +.chart-container h2 { + font-weight: 700; + font-size: 1.125rem; +} + +.item-container { + background-color: var(--grey-lighter); + border-radius: 0.3rem; + padding: 1.2rem 1rem; + margin: 1rem auto; +} + +.item-container:hover { + background-color: var(--grey-dark-lighter); + transition: all 0.3s ease-in-out; + cursor: pointer; +} + +.count-container { + font-weight: 700; + font-size: 1.7rem; + background-color: var(--mauve-light); + color: var(--mauve); + height: 50px; + width: 50px; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; +} + +.item-header { + display: flex; + align-items: flex-start; +} + +.item-title h3 { + font-size: 1.3rem; + font-weight: 700; +} + +.item-content ul { + list-style: none; + padding-left: 0px; +} + +.item-content ul>li { + font-size: 0.9rem; + color: var(--grey); + font-weight: 700; +} + +/* Misc */ +.card-shadow { + -webkit-box-shadow: 1px 3px 5px 0px rgba(222, 222, 222, 1); + -moz-box-shadow: 1px 3px 5px 0px rgba(222, 222, 222, 1); + box-shadow: 1px 3px 5px 0px rgba(222, 222, 222, 1); +} + +/* Table */ +thead { + background-color: #e9ecf0; + border-bottom: none; +} + +.table thead th { + border-bottom: none; +} + +.table td, +.table th { + border-top: 1px solid #eceff2; +} + +.crm_scroll_table { + max-height: 395px; + overflow-y: auto; +} +.recent_activity_div .crm_scroll_table { + max-height: 435px; +} + +.crm_scroll_table thead { + position: sticky; + top: 0; +} + +.crm_scroll_table .count-container { + height: 45px; + width: 130px; + border-radius: 50px; + margin-right: 10px; +} + +.crm_scroll_table .item-content ul > li { + font-size: 1.1rem; +} diff --git a/venue_booking_management/static/src/xml/dashboard_templates.xml b/venue_booking_management/static/src/xml/dashboard_templates.xml new file mode 100644 index 000000000..10f87c7ef --- /dev/null +++ b/venue_booking_management/static/src/xml/dashboard_templates.xml @@ -0,0 +1,272 @@ + + + diff --git a/venue_booking_management/views/amenities_views.xml b/venue_booking_management/views/amenities_views.xml new file mode 100644 index 000000000..8a0bbfec4 --- /dev/null +++ b/venue_booking_management/views/amenities_views.xml @@ -0,0 +1,52 @@ + + + + + amenities.view.tree + amenities + + + + + + + + + amenities.view.form + amenities + +
+ + + + + + +
+ + + +
+
+
+
+ + + Amenities + amenities + ir.actions.act_window + tree,form + +

+ Click to add Amenities. +

+

+ Here you can create different types of Amenities. +

+
+
+ + +
diff --git a/venue_booking_management/views/dashboard_views.xml b/venue_booking_management/views/dashboard_views.xml new file mode 100644 index 000000000..31fc0e000 --- /dev/null +++ b/venue_booking_management/views/dashboard_views.xml @@ -0,0 +1,23 @@ + + + + + Dashboard + dashboard_tags + + + + + + + + + diff --git a/venue_booking_management/views/res_config_settings_views.xml b/venue_booking_management/views/res_config_settings_views.xml new file mode 100644 index 000000000..16eac80a8 --- /dev/null +++ b/venue_booking_management/views/res_config_settings_views.xml @@ -0,0 +1,57 @@ + + + + + + res.config.settings.view.form.inherit.space.reservation.management + + res.config.settings + + + + +
+

Pricing

+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + Settings + ir.actions.act_window + res.config.settings + form + inline + {'module' : + 'venue_booking_management','bin_size': False} + + + + +
diff --git a/venue_booking_management/views/res_partner_views.xml b/venue_booking_management/views/res_partner_views.xml new file mode 100644 index 000000000..0f5e91055 --- /dev/null +++ b/venue_booking_management/views/res_partner_views.xml @@ -0,0 +1,29 @@ + + + + + Customers + ir.actions.act_window + res.partner + kanban,tree,form + {'search_default_customer': + 1,'res_partner_search_mode': 'customer', 'default_is_company': + True, 'default_customer_rank': 1} + + +

+ Create a new customer in your address book +

+

+ Odoo helps you easily track all activities related to a + customer. +

+
+
+ + +
diff --git a/venue_booking_management/views/venue_booking_views.xml b/venue_booking_management/views/venue_booking_views.xml new file mode 100644 index 000000000..7d13527af --- /dev/null +++ b/venue_booking_management/views/venue_booking_views.xml @@ -0,0 +1,301 @@ + + + + + venue.booking.view.tree + venue.booking + + + + + + + + + + + + + + + venue.booking.view.kanban + venue.booking + + + + + +
+
+ + type + +
+
+
+ + + +
+
+
+
+ + + + + + + + venue.booking.view.form + venue.booking + +
+
+
+ +
+ +
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+ + + + + + venue.booking.view.search + venue.booking + + + + + + + + + + + + + + venue.booking.view.calendar + venue.booking + + + + + + + + + + + venue.booking.view.graph + venue.booking + + + + + + + + + + venue.booking.view.pivot + venue.booking + + + + + + + + + + + + Venue Booking + venue.booking + ir.actions.act_window + kanban,tree,form,calendar,graph,pivot + +

+ Click to add an Venue Reservation. +

+

+ Here you can create and manage your Venue . +

+
+
+ + + Booking Requests + ir.actions.act_window + venue.booking + tree,form,kanban,calendar + [('state','=','draft')] + {'create': False} + +

+ Create a new record! +

+
+
+ + + Confirmed bookings + ir.actions.act_window + venue.booking + tree,form,kanban,calendar + [('state','in',['confirm', 'invoice'])] + {'create': False} + +

+ Create a new record! +

+
+
+ + + + + + + diff --git a/venue_booking_management/views/venue_type_views.xml b/venue_booking_management/views/venue_type_views.xml new file mode 100644 index 000000000..1c5d99ff7 --- /dev/null +++ b/venue_booking_management/views/venue_type_views.xml @@ -0,0 +1,51 @@ + + + + + venue.type.view.tree + venue.type + + + + + + + + venue.type.view.form + venue.type + +
+ +
+ +
+

+ +

+
+
+
+
+ + Venue type + venue.type + ir.actions.act_window + tree,form + +

+ Click to add Venue type. +

+

+ Here you can create different types of venue. +

+
+
+ + +
diff --git a/venue_booking_management/views/venue_views.xml b/venue_booking_management/views/venue_views.xml new file mode 100644 index 000000000..9d31d3477 --- /dev/null +++ b/venue_booking_management/views/venue_views.xml @@ -0,0 +1,180 @@ + + + + + venue.view.tree + venue + + + + + + + + + + + venue.view.form + venue + +
+ + + + + + + + + + + + + + + + + + Capacity:Units + + + + Seating:Units + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+ + Venue + venue + ir.actions.act_window + tree,form + +

+ Click to add Venue. +

+

+ Here you can create different Venue. +

+
+
+ + + venue.view.kanban + venue + kanban + + + + + + + +
+
+ +
+
+ +
+ Image +
+
+ + + Total Booking : + + + +
+
+
+
+
+
+
+
+ + + Venue Booking Kanban Board + venue + kanban,form + {} + + +
diff --git a/venue_booking_management/views/website_portal_templates.xml b/venue_booking_management/views/website_portal_templates.xml new file mode 100644 index 000000000..0b820a8fc --- /dev/null +++ b/venue_booking_management/views/website_portal_templates.xml @@ -0,0 +1,203 @@ + + + + + + + + + + diff --git a/venue_booking_management/views/website_venue_booking_templates.xml b/venue_booking_management/views/website_venue_booking_templates.xml new file mode 100644 index 000000000..f3e64fce5 --- /dev/null +++ b/venue_booking_management/views/website_venue_booking_templates.xml @@ -0,0 +1,136 @@ + + + + Venue Booking + /venue/booking + + 200 + + + + + + diff --git a/venue_booking_management/wizards/__init__.py b/venue_booking_management/wizards/__init__.py new file mode 100644 index 000000000..ae03a5ce0 --- /dev/null +++ b/venue_booking_management/wizards/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 check_venue_availability +from . import venue_booking_analysis diff --git a/venue_booking_management/wizards/check_venue_availability.py b/venue_booking_management/wizards/check_venue_availability.py new file mode 100644 index 000000000..6bc59a3b1 --- /dev/null +++ b/venue_booking_management/wizards/check_venue_availability.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 +from odoo.exceptions import ValidationError + + +class VenueAvailable(models.TransientModel): + """Model for managing the Venue availability information""" + _name = 'check.venue.availability' + _description = 'Venue Availability' + + booking_type = fields.Selection([('day', 'Day'), + ('hour', 'Hours')], string='Booking Type', + default='day', + help='The selection field for Booking Type') + venue_id = fields.Many2one('venue', string='Venue', + help='You can choose the Venue', required=True) + start_date = fields.Datetime(string="Start date", + default=lambda self: fields.datetime.now(), + required=True, + help='Venue Booking Start Date') + end_date = fields.Datetime(string="End date", required=True, + help='Venue Booking End Date') + budget = fields.Float(string="Booking Amount Budget", + help='We can check the budget amount') + capacity = fields.Float(string="Capacity", + help='Venue capacity for the Booking') + + def action_search_venue(self): + """"The button to search for bookings and check the bookings + availability""" + booking = self.env['venue.booking'].search([ + ('venue_id', '=', self.venue_id.id), + ('start_date', '<', self.end_date), + ('end_date', '>', self.start_date), + ]) + if booking: + raise ValidationError( + "Venue is not available for the selected time range.") + venue = self.env['venue'].browse(int(self.venue_id.id)) + if venue and venue.capacity <= self.capacity: + raise ValidationError( + "Venue is not available for the specified capacity.") + budget_limit_exceeded = False + if self.booking_type == 'day': + budget_limit_exceeded = self.venue_id.venue_charge_day + self.venue_id.additional_charge_day > self.budget + elif self.booking_type == 'hour': + budget_limit_exceeded = self.venue_id.venue_charge_hour + self.venue_id.additional_charge_hour > self.budget + if self.budget and budget_limit_exceeded: + raise ValidationError( + "Venue is not available for the specified Budget.") + else: + view_id = self.env.ref( + 'venue_booking_management.venue_booking_view_form').id + return { + 'type': 'ir.actions.act_window', + 'name': 'Venue Booking', + 'view_mode': 'form', + 'res_model': 'venue.booking', + 'target': 'current', + 'context': { + 'create': True, + 'default_venue_id': self.venue_id.id, + 'default_booking_type': self.booking_type, + 'default_end_date': self.end_date, + 'default_start_date': self.start_date, + }, + 'views': [[view_id, 'form']], + } diff --git a/venue_booking_management/wizards/check_venue_availability_views.xml b/venue_booking_management/wizards/check_venue_availability_views.xml new file mode 100644 index 000000000..6a54f3388 --- /dev/null +++ b/venue_booking_management/wizards/check_venue_availability_views.xml @@ -0,0 +1,50 @@ + + + + + check.venue.availability.view.form + check.venue.availability + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + Check Venue Availability + check.venue.availability + ir.actions.act_window + form + + new + + + +
diff --git a/venue_booking_management/wizards/venue_booking_analysis.py b/venue_booking_management/wizards/venue_booking_analysis.py new file mode 100644 index 000000000..8fdf05463 --- /dev/null +++ b/venue_booking_management/wizards/venue_booking_analysis.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 . +# +############################################################################### +import json +import pytz +from odoo import fields, models +from odoo.exceptions import ValidationError +from odoo.tools import date_utils, io, xlsxwriter + + +class VenueBookingAnalysis(models.TransientModel): + """Model for generating the Venue Booking Reports in xls and pdf""" + _name = 'venue.booking.analysis' + _description = 'Venue Booking Analysis' + + venue_id = fields.Many2one('venue', string='Venue', + help='You can choose the Venue') + start_date = fields.Datetime(string="Start date", + help='Venue Booking Start Date') + end_date = fields.Datetime(string="End date", help='Venue Booking End Date') + partner_id = fields.Many2one('res.partner', string='Customer', + help='Field to choosing the customer') + def action_print_pdf(self): + """Function used to print the PDF of the Venue Booking""" + venue = self.env['venue.booking'].search([]) + data = { + 'model': 'venue.booking.analysis', + 'form': self.read()[0], + 'venue': venue + } + return self.env.ref( + 'venue_booking_management.action_venue_booking_management_report').report_action( + self, data=data) + def action_print_xlsx(self): + """Method of button for printing xlsx report""" + rec = self.env.user.sudo().company_id + if self.start_date and self.end_date and self.start_date > self.end_date: + raise ValidationError('Start Date must be less than End Date') + user_tz = self.env.user.tz + current = fields.datetime.now() + current = pytz.UTC.localize(current) + current = current.astimezone(pytz.timezone(user_tz)) + venue = self.env['venue.booking'].search([]) + data = { + 'start_date': self.start_date, + 'end_date': self.end_date, + 'customer': self.partner_id.id, + 'venue_id': self.venue_id, + 'today_date': current, + 'company': [rec.partner_id.name, rec.street, rec.logo], + 'form': self.read()[0], + 'venue': venue + } + return { + 'type': 'ir.actions.report', + 'report_type': 'xlsx', + 'data': {'model': 'venue.booking.analysis', + 'output_format': 'xlsx', + 'options': json.dumps(data, + default=date_utils.json_default), + 'report_name': 'Venue Booking Report', }, + } + def get_xlsx_report(self, data, response): + """Method for fetching data and printing xlsx report from controller""" + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + head = workbook.add_format({'align': 'center', + 'bold': True, 'font_size': '20px'}) + cell_head_format = workbook.add_format({'font_size': '12px'}) + cell_data_format = workbook.add_format({'font_size': '10px'}) + txt_head = workbook.add_format( + {'bold': True, 'font_size': '12px', 'border': 2}) + txt = workbook.add_format({'font_size': '10px', 'border': 1}) + sheet.merge_range('F2:M3', 'Venue Booking Report', head) + sheet.merge_range('B4:E4', data['company'][0], cell_head_format) + sheet.merge_range('B5:E5', data['company'][1], cell_head_format) + sheet.write('B6', 'Date:', cell_head_format) + sheet.merge_range('C6:E6', data['today_date'], cell_data_format) + form_data = data['form'] + if form_data['start_date'] and form_data['end_date'] and form_data[ + 'partner_id']: + customer_name = self.env['res.partner'].browse(int( + form_data['partner_id'][0])).name + sheet.write('B8', 'From:', cell_head_format) + sheet.merge_range('C8:D8', form_data['start_date'], + cell_data_format) + sheet.write('F8', 'To:', cell_head_format) + sheet.merge_range('G8:H8', form_data['end_date'], cell_data_format) + sheet.merge_range('J8:K8', 'Customer:', cell_head_format) + sheet.merge_range('L8:N8', customer_name, cell_data_format) + elif form_data['start_date'] and form_data['end_date']: + sheet.write('B8', 'From:', cell_head_format) + sheet.merge_range('C8:D8', form_data['start_date'], + cell_data_format) + sheet.write('F8', 'To:', cell_head_format) + sheet.merge_range('G8:H8', form_data['end_date'], cell_data_format) + elif form_data['start_date'] and form_data['partner_id']: + customer_name = self.env['res.partner'].browse(int( + form_data['partner_id'][0])).name + sheet.write('B8', 'From:', cell_head_format) + sheet.merge_range('C8:D8', form_data['start_date'], + cell_data_format) + sheet.merge_range('F8:G8', 'Customer:', cell_head_format) + sheet.merge_range('H8:J8', customer_name, cell_data_format) + elif form_data['partner_id'] and form_data['end_date']: + customer_name = self.env['res.partner'].browse(int( + form_data['partner_id'][0])).name + sheet.write('B8', 'To:', cell_head_format) + sheet.merge_range('C8:D8', form_data['end_date'], cell_data_format) + sheet.merge_range('F8:G8', 'Customer:', cell_head_format) + sheet.merge_range('H8:J8', customer_name, cell_data_format) + elif form_data['start_date']: + sheet.write('B8', 'From:', cell_head_format) + sheet.merge_range('C8:D8', form_data['start_date'], + cell_data_format) + elif form_data['end_date']: + sheet.write('B8', 'To:', cell_head_format) + sheet.merge_range('C8:D8', form_data['end_date'], cell_data_format) + elif form_data['partner_id']: + customer_name = self.env['res.partner'].browse(int( + form_data['partner_id'][0])).name + sheet.merge_range('B8:C8', 'Customer:', cell_head_format) + sheet.merge_range('D8:E8', customer_name, cell_data_format) + sheet.write(10, 0, 'Sl.no', txt_head) + sheet.merge_range('B11:D11', 'Ref No', txt_head) + sheet.merge_range('E11:G11', 'Venue', txt_head) + sheet.merge_range('H11:I11', 'Booking Type', txt_head) + sheet.merge_range('J11:L11', 'Customer', txt_head) + sheet.merge_range('M11:N11', 'Start Date', txt_head) + sheet.merge_range('O11:P11', 'End Date', txt_head) + sheet.merge_range('Q11:R11', 'State', txt_head) + where = '1=1' + if form_data["partner_id"]: + where += """ AND tb.partner_id = %s""" % form_data['partner_id'][0] + if form_data['start_date']: + where += """ AND tb.date >= '%s'""" % form_data['start_date'] + if form_data['end_date']: + where += """ AND tb.date <= '%s'""" % form_data['end_date'] + if form_data['venue_id']: + where += """ AND tb.venue_id = %s""" % form_data['venue_id'][0] + self.env.cr.execute(""" + SELECT tb.ref, pr.name, fv.name as venue, tb.booking_type, + tb.date, tb.start_date, tb.end_date, tb.state + FROM venue_booking as tb + INNER JOIN res_partner as pr ON pr.id = tb.partner_id + INNER JOIN venue as fv ON fv.id = tb.venue_id + WHERE %s + """ % where) + rec = self.env.cr.dictfetchall() + j = 11 + k = 1 + for i in range(0, len(rec)): + sheet.write(j, 0, k, txt) + sheet.merge_range('B%d:D%d' % (j + 1, j + 1), rec[i]['ref'], txt) + sheet.merge_range('E%d:G%d' % (j + 1, j + 1), rec[i]['venue'], txt) + if rec[i]['booking_type'] == 'day': + sheet.merge_range('H%d:I%d' % (j + 1, j + 1), 'Day', txt) + elif rec[i]['booking_type'] == 'hour': + sheet.merge_range('H%d:I%d' % (j + 1, j + 1), 'Hour', txt) + else: + sheet.merge_range('H%d:I%d' % (j + 1, j + 1), + rec[i]['booking_type'], txt) + sheet.merge_range('J%d:L%d' % (j + 1, j + 1), rec[i]['name'], txt) + sheet.merge_range('M%d:N%d' % (j + 1, j + 1), + fields.Datetime.to_string(rec[i]['start_date']), + txt) + sheet.merge_range('O%d:P%d' % (j + 1, j + 1), + fields.Datetime.to_string(rec[i]['end_date']), + txt) + if rec[i]['state'] == 'draft': + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), 'Draft', txt) + elif rec[i]['state'] == 'invoice': + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), 'Invoiced', txt) + elif rec[i]['state'] == 'confirm': + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), 'Confirm', txt) + elif rec[i]['state'] == 'cancel': + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), 'Cancelled', txt) + elif rec[i]['state'] == 'close': + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), 'closed', txt) + else: + sheet.merge_range('Q%d:R%d' % (j + 1, j + 1), rec[i]['state'], + txt) + j += 1 + k += 1 + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/venue_booking_management/wizards/venue_booking_analysis_views.xml b/venue_booking_management/wizards/venue_booking_analysis_views.xml new file mode 100644 index 000000000..f1016a62a --- /dev/null +++ b/venue_booking_management/wizards/venue_booking_analysis_views.xml @@ -0,0 +1,49 @@ + + + + + venue.booking.analysis.view.form + venue.booking.analysis + +
+ + + + + + + + + + + + +
+
+
+
+
+ + + Venue Booking Analysis + venue.booking.analysis + ir.actions.act_window + form + + new + + + +