diff --git a/fleet_rental_dashboard/README.rst b/fleet_rental_dashboard/README.rst new file mode 100644 index 000000000..e1185873c --- /dev/null +++ b/fleet_rental_dashboard/README.rst @@ -0,0 +1,47 @@ +.. 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 + +Fleet Rental Dashboard +====================== +This module adds a dashboard in fleet rental module. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16) Mruthul Raj, Contact: odoo@cybrosys.com + (V17) Ranjith R, 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/fleet_rental_dashboard/__init__.py b/fleet_rental_dashboard/__init__.py new file mode 100644 index 000000000..e869a78ca --- /dev/null +++ b/fleet_rental_dashboard/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. +############################################################################### +from . import models diff --git a/fleet_rental_dashboard/__manifest__.py b/fleet_rental_dashboard/__manifest__.py new file mode 100644 index 000000000..e4a252f32 --- /dev/null +++ b/fleet_rental_dashboard/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. +############################################################################### +{ + 'name': 'Fleet Rental Dashboard', + 'version': '17.0.1.0.0', + 'category': 'Productivity', + 'summary': 'Dashboard for fleet rental management', + 'description': 'This dashboard module enhances the fleet rental management ' + 'system by offering a centralized view of crucial metrics' + ' and analytics.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['fleet_rental', 'base'], + 'data': ['views/fleet_rental_dashboard_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'fleet_rental_dashboard/static/src/js/dashboard.js', + 'fleet_rental_dashboard/static/src/css/dashboard.css', + 'fleet_rental_dashboard/static/src/css/style.scss', + 'fleet_rental_dashboard/static/src/xml/dashboard_templates.xml', + 'https://cdn.jsdelivr.net/npm/chart.js', + 'https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/fleet_rental_dashboard/doc/RELEASE_NOTES.md b/fleet_rental_dashboard/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..8fc11a50b --- /dev/null +++ b/fleet_rental_dashboard/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 23.04.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for Fleet Rental Dashboard diff --git a/fleet_rental_dashboard/models/__init__.py b/fleet_rental_dashboard/models/__init__.py new file mode 100644 index 000000000..afcf2fa97 --- /dev/null +++ b/fleet_rental_dashboard/models/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. +############################################################################### +from . import car_rental_contract diff --git a/fleet_rental_dashboard/models/car_rental_contract.py b/fleet_rental_dashboard/models/car_rental_contract.py new file mode 100644 index 000000000..80edf354e --- /dev/null +++ b/fleet_rental_dashboard/models/car_rental_contract.py @@ -0,0 +1,138 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. +############################################################################### +from odoo import api, models + + +class DashboardFleetRental(models.Model): + """Class for new function to get vehicle and customers details + vehicle_most_rented + function for getting most rented vehicle which + cars_availability + function for getting available and running car's + car_details + function for getting the car details + top_customers + function for getting top 10 customers + """ + + _inherit = "car.rental.contract" + + @api.model + def vehicle_most_rented(self, start_date, end_date): + """function for getting most rented vehicle if filters enabled or not + args: + start_date:filter for start date + end_date:end date filter + return: + result which include vehicle details and its count + """ + query = """SELECT vehicle_id,COUNT(*) AS num FROM car_rental_contract + WHERE state='done'""" + if start_date: + query += """ AND rent_start_date >= '%s'""" % start_date + if end_date: + query += """AND rent_start_date <= '%s'""" % end_date + query += """GROUP BY vehicle_id ORDER BY num DESC""" + self.env.cr.execute(query) + results = self.env.cr.fetchall() + cars = [] + count = [] + for vehicle_id, num in results: + if num > 0: + car = self.env['fleet.vehicle'].browse(vehicle_id) + cars.append( + car.name + ) + count.append(num) + result = { + 'name': cars, + 'num': count + } + return result + + @api.model + def cars_availability(self): + """function for getting available and running cars count + return: + count of available and running cars in result""" + available_cars = self.env['fleet.vehicle'].search_count( + [('rental_check_availability', '=', True)]) + cars_running = self.env['car.rental.contract'].search_count( + [('state', '=', 'running')]) + result = { + 'available_cars': available_cars, + 'cars_running': cars_running + } + return result + + @api.model + def car_details(self): + """ + function for getting details of running and available cars + return: + values which include details of running and available cars + """ + running_cars = self.env['car.rental.contract'].search( + [('state', '=', 'running')]) + cars_available = self.env['fleet.vehicle'].search( + [('rental_check_availability', '=', True)]) + running_details = [] + available_cars = [] + for record in running_cars: + running_details.append({'vehicle': record.vehicle_id.name, + 'start_date': record.rent_start_date, + 'end_date': record.rent_end_date, + 'customer': record.customer_id.name, + 'phone': record.customer_id.phone, + }) + for record in cars_available: + available_cars.append({ + 'available_car': record.name, + }) + values = { + 'running_details': running_details, + 'available_cars': available_cars + } + return values + + @api.model + def top_customers(self): + """function for getting top 10 customers + return top customers which include their name,image and email + """ + rental_partners_count = self.env['car.rental.contract'].read_group( + [('state', 'in', ['done'])], + fields=['customer_id'], + groupby=['customer_id'], ) + sorted_rental_partners_count = sorted(rental_partners_count, + key=lambda k: k[ + 'customer_id_count'], + reverse=True) + limited = sorted_rental_partners_count[:10] + top_customers = [] + for rec in limited: + partner = self.env['res.partner'].browse(rec['customer_id'][0]) + top_customers.append({ + 'id': partner.id, + 'name': partner.name, + 'image': partner.image_1920, + 'email': partner.email + }) + return top_customers diff --git a/fleet_rental_dashboard/static/description/assets/icons/capture (1).png b/fleet_rental_dashboard/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/capture (1).png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/check.png b/fleet_rental_dashboard/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/check.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/chevron.png b/fleet_rental_dashboard/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/chevron.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/cogs.png b/fleet_rental_dashboard/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/cogs.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/consultation.png b/fleet_rental_dashboard/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/consultation.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/ecom-black.png b/fleet_rental_dashboard/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/ecom-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/education-black.png b/fleet_rental_dashboard/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/education-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/hotel-black.png b/fleet_rental_dashboard/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/hotel-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/img.png b/fleet_rental_dashboard/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/img.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/license.png b/fleet_rental_dashboard/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/license.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/lifebuoy.png b/fleet_rental_dashboard/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/lifebuoy.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/manufacturing-black.png b/fleet_rental_dashboard/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/manufacturing-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/photo-capture.png b/fleet_rental_dashboard/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/photo-capture.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/pos-black.png b/fleet_rental_dashboard/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/pos-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/puzzle.png b/fleet_rental_dashboard/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/puzzle.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/restaurant-black.png b/fleet_rental_dashboard/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/restaurant-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/service-black.png b/fleet_rental_dashboard/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/service-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/trading-black.png b/fleet_rental_dashboard/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/trading-black.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/training.png b/fleet_rental_dashboard/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/training.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/update.png b/fleet_rental_dashboard/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/update.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/user.png b/fleet_rental_dashboard/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/user.png differ diff --git a/fleet_rental_dashboard/static/description/assets/icons/wrench.png b/fleet_rental_dashboard/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/icons/wrench.png differ diff --git a/fleet_rental_dashboard/static/description/assets/misc/Cybrosys R.png b/fleet_rental_dashboard/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/misc/Cybrosys R.png differ diff --git a/fleet_rental_dashboard/static/description/assets/misc/email.svg b/fleet_rental_dashboard/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/phone.svg b/fleet_rental_dashboard/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/star (1) 2.svg b/fleet_rental_dashboard/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/support (1) 1.svg b/fleet_rental_dashboard/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/support-email.svg b/fleet_rental_dashboard/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/tick-mark.svg b/fleet_rental_dashboard/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/whatsapp 1.svg b/fleet_rental_dashboard/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/misc/whatsapp.svg b/fleet_rental_dashboard/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/fleet_rental_dashboard/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fleet_rental_dashboard/static/description/assets/modules/1.png b/fleet_rental_dashboard/static/description/assets/modules/1.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/1.png differ diff --git a/fleet_rental_dashboard/static/description/assets/modules/2.jpg b/fleet_rental_dashboard/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/2.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/modules/3.png b/fleet_rental_dashboard/static/description/assets/modules/3.png new file mode 100644 index 000000000..cb17cf612 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/3.png differ diff --git a/fleet_rental_dashboard/static/description/assets/modules/4.png b/fleet_rental_dashboard/static/description/assets/modules/4.png new file mode 100644 index 000000000..d6b1fe049 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/4.png differ diff --git a/fleet_rental_dashboard/static/description/assets/modules/5.jpg b/fleet_rental_dashboard/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..87c2bb2ba Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/5.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/modules/6.png b/fleet_rental_dashboard/static/description/assets/modules/6.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/modules/6.png differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/hero.gif b/fleet_rental_dashboard/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..8f56964b2 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/hero.gif differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss1.jpg b/fleet_rental_dashboard/static/description/assets/screenshots/ss1.jpg new file mode 100644 index 000000000..9893d42d5 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss1.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss2.jpg b/fleet_rental_dashboard/static/description/assets/screenshots/ss2.jpg new file mode 100644 index 000000000..0f161d5cd Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss2.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss3.jpg b/fleet_rental_dashboard/static/description/assets/screenshots/ss3.jpg new file mode 100644 index 000000000..3f7fd8238 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss3.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss4.png b/fleet_rental_dashboard/static/description/assets/screenshots/ss4.png new file mode 100644 index 000000000..f31a891d5 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss4.png differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss5.jpg b/fleet_rental_dashboard/static/description/assets/screenshots/ss5.jpg new file mode 100644 index 000000000..f14d6c33a Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss5.jpg differ diff --git a/fleet_rental_dashboard/static/description/assets/screenshots/ss6.jpg b/fleet_rental_dashboard/static/description/assets/screenshots/ss6.jpg new file mode 100644 index 000000000..122715514 Binary files /dev/null and b/fleet_rental_dashboard/static/description/assets/screenshots/ss6.jpg differ diff --git a/fleet_rental_dashboard/static/description/banner.jpg b/fleet_rental_dashboard/static/description/banner.jpg new file mode 100644 index 000000000..ef8ba137d Binary files /dev/null and b/fleet_rental_dashboard/static/description/banner.jpg differ diff --git a/fleet_rental_dashboard/static/description/icon.png b/fleet_rental_dashboard/static/description/icon.png new file mode 100644 index 000000000..89a858543 Binary files /dev/null and b/fleet_rental_dashboard/static/description/icon.png differ diff --git a/fleet_rental_dashboard/static/description/index.html b/fleet_rental_dashboard/static/description/index.html new file mode 100644 index 000000000..1678cb0ea --- /dev/null +++ b/fleet_rental_dashboard/static/description/index.html @@ -0,0 +1,731 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Fleet Rental Dashboard

+

+ This Dashboard Module Enhances the Fleet Rental Management + System by Offering a Centralized View of Crucial Metrics and + Analytics. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Dashboard with date filtration.

+
+
+
+
+
+
+ +
+
+

+ Pie,Bar and Line graph available.

+
+
+
+
+
+
+ +
+
+

+ Available vehicles and running vehicles on + dashboard.

+
+
+
+
+
+
+ +
+
+

+ Available in Odoo 17.

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

+ Install Fleet + Rental Management from Odoo app store. +

+
+
+
+
+
+
+ + +
+
+

+ Dashboard View

+
+ An elaborated dashboard view with Top + Customers, Most Rented + Cars and Available Vehicles.
+
+
+
+
+
+
+ +
+
+

+ Available Vehicles With Scroll Bar

+
+ This will display available vehicles name + and numbers of cars on + road.
+
+
+
+
+
+
+ + +
+
+

+ Date Filter

+
+ You can filter by date to get details of some specif date.
+
+
+
+
+
+
+
    +
  • + Dashboard with date filtration. +
  • +
  • + Pie,Bar and Line graph available. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on: 23rd Apr 2024 +
+

+ Initial Commit for Fleet Rental Dashboard.

+
+
+
+
+
+
+
+

+ 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/fleet_rental_dashboard/static/src/css/dashboard.css b/fleet_rental_dashboard/static/src/css/dashboard.css new file mode 100644 index 000000000..0a1c8704b --- /dev/null +++ b/fleet_rental_dashboard/static/src/css/dashboard.css @@ -0,0 +1,56 @@ +p, +span, +a, +ul, +li, +button { + font-size: inherit; + font-weight: inherit; + line-height: inherit; +} + +strong { + font-weight: 600; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.5em; + font-weight: 300; +} + +strong { + font-weight: 400; +} + +.sub_title { + font-size: 14px; +} + +.sub_title div span { + font-weight: 600; +} + +.chart #canvas_graph { + height: 400px !important; +} + +.highcharts-background { + fill: none; +} + +html .o_web_client>.o_action_manager { + overflow: scroll; +} + +.available_cars { + overflow: scroll; +} + +running_vehicle_contact { + overflow: scroll; +} \ No newline at end of file diff --git a/fleet_rental_dashboard/static/src/css/style.scss b/fleet_rental_dashboard/static/src/css/style.scss new file mode 100644 index 000000000..3f29265fc --- /dev/null +++ b/fleet_rental_dashboard/static/src/css/style.scss @@ -0,0 +1,236 @@ +: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; +} + +.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; +} \ No newline at end of file diff --git a/fleet_rental_dashboard/static/src/js/dashboard.js b/fleet_rental_dashboard/static/src/js/dashboard.js new file mode 100644 index 000000000..42e1eb7b7 --- /dev/null +++ b/fleet_rental_dashboard/static/src/js/dashboard.js @@ -0,0 +1,189 @@ +/** @odoo-module **/ + +import {registry} from "@web/core/registry"; +import {Component, onWillStart} from "@odoo/owl"; +import {useService} from "@web/core/utils/hooks"; +import { useRef, onPatched, onMounted, useState } from "@odoo/owl"; +const actionRegistry = registry.category("actions"); + +export class DashboardFleetRental extends Component { + async setup() { + this.orm = useService("orm"); + this.action = useService("action"); + this.state = useState({ + top_customers: {}, + available_vehicle_details: {}, + available_cars: false, + running_cars: {}, + running_vehicle_details: {}, + }); + this.modal_warning = useRef("modal_warning"); + this.most_rented_cars_bar = useRef("most_rented_cars_bar"); + this.most_rented_cars_line = useRef("most_rented_cars_line"); + this.most_rented_cars_pie = useRef("most_rented_cars_pie"); + this.start_date = useRef("start_date"); + this.end_date = useRef("end_date"); + // When the component is about to start, fetch data in tiles + onWillStart(async () => { + this.props.title = 'Dashboard'; + await this.fetch_data(); + }); + // When the component is mounted, render various charts + onMounted(async () => { + await this.render_graphs(); + }); + } + render_graphs(){ + this.render_most_rented_cars_bar(); + } + async fetch_data() { + var self = this; + await this.orm.call("car.rental.contract", "cars_availability", [] + ).then(function(data) { + self.state.available_cars = data['available_cars'] + self.state.running_cars = data['cars_running'] + }); + await this.orm.call("car.rental.contract", "car_details", [] + ).then(function(data) { + self.state.running_vehicle_details = data['running_details'] + self.state.available_vehicle_details = data['available_cars'] + }); + await this.orm.call("car.rental.contract", "top_customers", [] + ).then(function(data) { + self.state.top_customers = data + }); + } + render_most_rented_cars_bar() { + var self = this; + // Destroy previous chart instances if they exist + if (this.chartStatus) { + if (this.chartStatus.bar) { + this.chartStatus.bar.destroy(); + } + if (this.chartStatus.line) { + this.chartStatus.line.destroy(); + } + if (this.chartStatus.pie) { + this.chartStatus.pie.destroy(); + } + } + + // Render new charts + this.orm.call('car.rental.contract', 'vehicle_most_rented', [this.start_date.el.value, this.end_date.el.value]).then(result => { + const colors = ["red", "blue", "green", "orange", "purple", "steel", "rebecca", "brown", "pink", "grey", "black"]; + var ctx = self.most_rented_cars_bar.el; + var ctx2 = self.most_rented_cars_line.el; + var ctx3 = self.most_rented_cars_pie.el; + var name = result.name; + var count = result.num; + + // Create new chart instances + var myChart = new Chart(ctx, { + type: 'bar', + data: { + labels: name, + datasets: [{ + label: 'Count', + data: count, + backgroundColor: colors, + borderColor: colors, + barPercentage: 0.5, + barThickness: 100, + maxBarThickness: 100, + minBarLength: 0, + borderWidth: 1, + fill: false + }] + }, + options: { + scales: { + y: { + beginAtZero: true + }, + }, + responsive: true, + maintainAspectRatio: false, + } + }); + + var myChart2 = new Chart(ctx2, { + type: 'line', + data: { + labels: name, + datasets: [{ + label: 'Count', + data: count, + backgroundColor: colors, + borderColor: colors, + barPercentage: 0.5, + barThickness: 6, + maxBarThickness: 8, + minBarLength: 0, + borderWidth: 1, + type: 'line', + fill: false + }] + }, + options: { + scales: { + y: { + beginAtZero: true + }, + }, + responsive: true, + maintainAspectRatio: false, + } + }); + + var myChart3 = new Chart(ctx3, { + type: 'pie', + data: { + labels: name, + datasets: [{ + label: 'Count', + data: count, + backgroundColor: colors, + borderColor: colors, + type: 'pie', + fill: false + }] + }, + options: { + scales: { + y: { + beginAtZero: true + }, + }, + responsive: true, + maintainAspectRatio: false, + } + }); + + // Save chart instances + this.chartStatus = { + bar: myChart, + line: myChart2, + pie: myChart3 + }; + + }).catch(error => { + console.error('Error rendering chart:', error); + }); +} + onApplyFilter(){ + if(this.start_date.el.value && this.end_date.el.value){ + if(this.start_date.el.value>this.end_date.el.value){ + this.modal_warning.el.style.display = "block"; + return false + } + + } + this.render_graphs() + } + closeModal(){ + this.modal_warning.el.style.display = "none"; + } +} + +DashboardFleetRental.template = "CustomDashBoard"; +actionRegistry.add("fleet_rental_dashboard", DashboardFleetRental); diff --git a/fleet_rental_dashboard/static/src/xml/dashboard_templates.xml b/fleet_rental_dashboard/static/src/xml/dashboard_templates.xml new file mode 100644 index 000000000..cc90fee68 --- /dev/null +++ b/fleet_rental_dashboard/static/src/xml/dashboard_templates.xml @@ -0,0 +1,250 @@ + + diff --git a/fleet_rental_dashboard/views/fleet_rental_dashboard_views.xml b/fleet_rental_dashboard/views/fleet_rental_dashboard_views.xml new file mode 100644 index 000000000..6e6f0b260 --- /dev/null +++ b/fleet_rental_dashboard/views/fleet_rental_dashboard_views.xml @@ -0,0 +1,11 @@ + + + + Fleet.Rental.Dashboard + fleet_rental_dashboard + + + +