diff --git a/fleet_complete_report/README.rst b/fleet_complete_report/README.rst new file mode 100755 index 000000000..a47acf742 --- /dev/null +++ b/fleet_complete_report/README.rst @@ -0,0 +1,41 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Fleet - Complete Report +========================= +This module allow to print complete fleet report. + +Configuration +============= +The user should be added to the security group: Administrator(Human Resources/ Fleet) inorder to get access to the new menu. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Abhishek E T @cybrosys, 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_complete_report/__init__.py b/fleet_complete_report/__init__.py new file mode 100644 index 000000000..fc3447f47 --- /dev/null +++ b/fleet_complete_report/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 report +from . import wizard diff --git a/fleet_complete_report/__manifest__.py b/fleet_complete_report/__manifest__.py new file mode 100644 index 000000000..56e090067 --- /dev/null +++ b/fleet_complete_report/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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': 'Fleet - Complete Report', + 'version': '13.0.1.0.0', + 'category': 'Human Resources/Fleet', + 'summary': 'Custom report for Fleet', + 'description': 'Create complete PDF report for Fleet', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.png'], + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'fleet'], + 'data': [ + 'security/ir.model.access.csv', + 'report/vehicle_detail_report_templates.xml', + 'report/vehicle_detail_reports.xml', + 'wizard/vehicle_detail_views.xml' + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/fleet_complete_report/doc/RELEASE_NOTES.md b/fleet_complete_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..8ffdd0a51 --- /dev/null +++ b/fleet_complete_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### __.09.2022 +#### Version 14.0.1.0.0 +#### ADD + +- Initial commit for Fleet - Complete Report diff --git a/fleet_complete_report/report/__init__.py b/fleet_complete_report/report/__init__.py new file mode 100644 index 000000000..17156b7d1 --- /dev/null +++ b/fleet_complete_report/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 vehicle_detail_report diff --git a/fleet_complete_report/report/vehicle_detail_report.py b/fleet_complete_report/report/vehicle_detail_report.py new file mode 100644 index 000000000..bf71c9e55 --- /dev/null +++ b/fleet_complete_report/report/vehicle_detail_report.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 VehicleDetailReport(models.TransientModel): + _name = 'report.fleet_complete_report.report_vehicle_detail' + _description = 'Vehicle Details PDF Report' + + @api.model + def _get_report_values(self, docids, data=None): + """ + override the method to create custom report with custom values + :param docids: the recordset/ record from which the report action is + invoked + :param data: report data + :return: data and recodsets to be used in the report template + """ + docs = self.env['vehicle.detail'].browse( + self.env.context.get('active_id')) + lang = self.env['res.lang'].search( + [('code', '=', self.env.context.get('lang'))]) + vehicle_ids = data.get('vehicle_ids') + vehicles = docs.vehicle_ids.browse(vehicle_ids) + vehicles = vehicles.sorted(key=lambda rec: rec.state_id.sequence) + states = docs.state_ids.sorted(key=lambda rec: rec.sequence) + period = None + end_date = docs.end_date + if not end_date: + end_date = fields.Date.context_today(self) + if docs.start_date: + period = "From " + docs.start_date.strftime( + lang.date_format) + " To " + end_date.strftime(lang.date_format) + contracts = self.env['fleet.vehicle.log.contract'].sudo().search( + [('vehicle_id', 'in', vehicles.ids), + ('start_date', '<=', end_date), + '|', ('expiration_date', '>=', docs.start_date), + ('expiration_date', '=', False) + ], + order='vehicle_id ASC, state ASC, start_date DESC') + services = self.env['fleet.vehicle.log.services'].sudo().search( + [('vehicle_id', 'in', vehicles.ids), + ('date', '>=', docs.start_date), ('date', '<=', end_date)], + order='vehicle_id ASC, date DESC') + odometers = self.env['fleet.vehicle.odometer'].sudo().search( + [('vehicle_id', 'in', vehicles.ids), + ('date', '>=', docs.start_date), ('date', '<=', end_date)], + order='vehicle_id ASC, date DESC') + drivers_history = self.env[ + 'fleet.vehicle.assignation.log'].sudo().search( + [('vehicle_id', 'in', vehicles.ids), ('date_start', '<=', end_date), + '|', ('date_end', '>=', docs.start_date), + ('date_end', '=', False)], order='vehicle_id ASC, date_start ASC') + return { + 'doc_ids': self.ids, + 'docs': docs, + 'states': states, + 'state_names': ", ".join(states.mapped('name')), + 'vehicles': vehicles, + 'vehicle_names': ", ".join(vehicles.mapped('name')), + 'period': period, + 'contracts': contracts, + 'services': services, + 'odometers': odometers, + 'drivers_history': drivers_history + } diff --git a/fleet_complete_report/report/vehicle_detail_report_templates.xml b/fleet_complete_report/report/vehicle_detail_report_templates.xml new file mode 100644 index 000000000..ba1fb8b52 --- /dev/null +++ b/fleet_complete_report/report/vehicle_detail_report_templates.xml @@ -0,0 +1,307 @@ + + + + + \ No newline at end of file diff --git a/fleet_complete_report/report/vehicle_detail_reports.xml b/fleet_complete_report/report/vehicle_detail_reports.xml new file mode 100644 index 000000000..e225cea27 --- /dev/null +++ b/fleet_complete_report/report/vehicle_detail_reports.xml @@ -0,0 +1,11 @@ + + + + + Fleet - Complete Report + vehicle.detail + qweb-pdf + fleet_complete_report.report_vehicle_detail + fleet_complete_report.report_vehicle_detail + + \ No newline at end of file diff --git a/fleet_complete_report/security/ir.model.access.csv b/fleet_complete_report/security/ir.model.access.csv new file mode 100644 index 000000000..9b0ca5389 --- /dev/null +++ b/fleet_complete_report/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_vehicle_detail,access.vehicle.detail,model_vehicle_detail,base.group_user,1,1,1,1 diff --git a/fleet_complete_report/static/description/assets/icons/check.png b/fleet_complete_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/check.png differ diff --git a/fleet_complete_report/static/description/assets/icons/chevron.png b/fleet_complete_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/chevron.png differ diff --git a/fleet_complete_report/static/description/assets/icons/cogs.png b/fleet_complete_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/cogs.png differ diff --git a/fleet_complete_report/static/description/assets/icons/consultation.png b/fleet_complete_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/consultation.png differ diff --git a/fleet_complete_report/static/description/assets/icons/ecom-black.png b/fleet_complete_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/ecom-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/education-black.png b/fleet_complete_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/education-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/hotel-black.png b/fleet_complete_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/hotel-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/license.png b/fleet_complete_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/license.png differ diff --git a/fleet_complete_report/static/description/assets/icons/lifebuoy.png b/fleet_complete_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/lifebuoy.png differ diff --git a/fleet_complete_report/static/description/assets/icons/logo.png b/fleet_complete_report/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/logo.png differ diff --git a/fleet_complete_report/static/description/assets/icons/manufacturing-black.png b/fleet_complete_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/pos-black.png b/fleet_complete_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/pos-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/puzzle.png b/fleet_complete_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/puzzle.png differ diff --git a/fleet_complete_report/static/description/assets/icons/restaurant-black.png b/fleet_complete_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/restaurant-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/service-black.png b/fleet_complete_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/service-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/trading-black.png b/fleet_complete_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/trading-black.png differ diff --git a/fleet_complete_report/static/description/assets/icons/training.png b/fleet_complete_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/training.png differ diff --git a/fleet_complete_report/static/description/assets/icons/update.png b/fleet_complete_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/update.png differ diff --git a/fleet_complete_report/static/description/assets/icons/user.png b/fleet_complete_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/user.png differ diff --git a/fleet_complete_report/static/description/assets/icons/wrench.png b/fleet_complete_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/fleet_complete_report/static/description/assets/icons/wrench.png differ diff --git a/fleet_complete_report/static/description/assets/modules/budget_image.png b/fleet_complete_report/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/budget_image.png differ diff --git a/fleet_complete_report/static/description/assets/modules/credit_image.png b/fleet_complete_report/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/credit_image.png differ diff --git a/fleet_complete_report/static/description/assets/modules/employee_image.png b/fleet_complete_report/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/employee_image.png differ diff --git a/fleet_complete_report/static/description/assets/modules/export_image.png b/fleet_complete_report/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/export_image.png differ diff --git a/fleet_complete_report/static/description/assets/modules/gantt_image.png b/fleet_complete_report/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/gantt_image.png differ diff --git a/fleet_complete_report/static/description/assets/modules/quotation_image.png b/fleet_complete_report/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/fleet_complete_report/static/description/assets/modules/quotation_image.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_1.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_1.png new file mode 100644 index 000000000..7414f6782 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_1.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_10.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_10.png new file mode 100644 index 000000000..256235e48 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_10.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_2.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_2.png new file mode 100644 index 000000000..fc720cfdc Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_2.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_3.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_3.png new file mode 100644 index 000000000..fe2ef5877 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_3.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_4.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_4.png new file mode 100644 index 000000000..89e207b0a Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_4.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_5.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_5.png new file mode 100644 index 000000000..5f90a7649 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_5.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_6.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_6.png new file mode 100644 index 000000000..1a796fe7b Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_6.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_7.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_7.png new file mode 100644 index 000000000..347b78bc3 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_7.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_8.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_8.png new file mode 100644 index 000000000..305a78397 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_8.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_9.png b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_9.png new file mode 100644 index 000000000..ca4ba932a Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/fleet_complete_report_9.png differ diff --git a/fleet_complete_report/static/description/assets/screenshots/hero.png b/fleet_complete_report/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..feddc26c8 Binary files /dev/null and b/fleet_complete_report/static/description/assets/screenshots/hero.png differ diff --git a/fleet_complete_report/static/description/banner.png b/fleet_complete_report/static/description/banner.png new file mode 100644 index 000000000..4c535bc47 Binary files /dev/null and b/fleet_complete_report/static/description/banner.png differ diff --git a/fleet_complete_report/static/description/icon.png b/fleet_complete_report/static/description/icon.png new file mode 100644 index 000000000..bd64992a6 Binary files /dev/null and b/fleet_complete_report/static/description/icon.png differ diff --git a/fleet_complete_report/static/description/index.html b/fleet_complete_report/static/description/index.html new file mode 100644 index 000000000..448b4e0fc --- /dev/null +++ b/fleet_complete_report/static/description/index.html @@ -0,0 +1,553 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+ +
+
+
+

+ Fleet - Complete Report +

+

+ This module allows to generate complete PDF report for Fleet +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module crafted by Cybrosys Technologies provides an option to generate custom PDF report in Fleet with + vehicle details, contracts, services, odometer readings and drivers history for the selected period. +

+
+
+ +
+
+

+ Configuration +

+
+
+

The user should be added to the security group: Administrator(Human Resources/ Fleet) inorder to get access to the new menu.

+ +
+
+ +
+
+

+ Features +

+
+
+
+ +
+
+

+ New wizard

+

+ Use the new wizard that can be used to generate custom report. +

+
+
+
+
+ +
+
+

+ Detailed Report

+

+ The PDF report that contains vehicle details, contracts, services, odometer readings and drivers history for the selected vehicles. +

+
+
+
+ +
+
+

+ Screenshots +

+
+
+

New menu

+

+ Fleet -> Reporting -> Vehicle Details. Use this menu to open the wizard. +

+ +
+
+

Wizard to create custom report

+

+ This wizard can be used to generate a custom PDF report for Fleet. We can specify Start Date and End Date to filter the records based on the period. + The Start Date is a mandatory field. If we don't specify an End Date, then the current date will be taken. Then we can choose the state of vehicles + for which we have to generate the report.The States field is also a required one. Then, we can select Vehicles in the selected states. If we have + to print report for all vehicles for the selected states, leave Vehicles field as empty. Exclude Vehicle Data checkbox will be checked by default. + Uncheck it to show the vehicle data in the report. +

+ +
+
+

Vehicles

+

+ The report starts with the details like the period, the selected states of vehicles and the list of Vehicles. + The vehicle data will be displayed if Exclude Vehicle Data checkbox is unchecked. +

+ +
+
+

Contracts

+

+ All the contracts of the listed vehicles in the selected period grouped by vehicles. +

+ +
+
+

Services

+

+ All the service records of the listed vehicles in the selected period grouped by vehicles with vehicle wise total of service cost and the whole total. +

+ +
+
+

Odometers

+

+ All the odometer readings of the listed vehicles in the selected period grouped by vehicles. +

+ +
+
+

Drivers History

+

+ All the divers history of the listed vehicles in the selected period grouped by vehicles. +

+ +
+
+

Exclude Vehicle Data

+

+ Exclude Vehicle Data checkbox is checked by default. This will hide the vehicle data from the report. +

+ +
+
+

+ Then, the report will contain only the contracts, services, odometers and the drivers history. +

+ +
+
+ + +
+
+

Suggested Products

+
+ +
+
+ + + +
+
+
+

Our Services

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

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure and sell your products +

+
+
+ +
+
+ +
+ POS +
+

+ Easy configuration and convivial experience +

+
+
+ +
+
+ +
+ Education +
+

+ A platform for educational management +

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and schedule your operations +

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

+ Mobile friendly, awe-inspiring product pages +

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of services and invoice +

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or restaurant methodically +

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An all-inclusive hotel management application +

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

Need Help?

+
+
+
+ + +
+ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/fleet_complete_report/wizard/__init__.py b/fleet_complete_report/wizard/__init__.py new file mode 100644 index 000000000..2c8e82ea6 --- /dev/null +++ b/fleet_complete_report/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 vehicle_detail diff --git a/fleet_complete_report/wizard/vehicle_detail.py b/fleet_complete_report/wizard/vehicle_detail.py new file mode 100644 index 000000000..ce29a7399 --- /dev/null +++ b/fleet_complete_report/wizard/vehicle_detail.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 VehicleDetail(models.TransientModel): + _name = 'vehicle.detail' + _description = 'Vehicle Details' + + vehicle_ids = fields.Many2many('fleet.vehicle', string='Vehicles', + domain="[('state_id', 'in', state_ids)]", + help="List of vehicles to generate report") + state_ids = fields.Many2many( + 'fleet.vehicle.state', string='States', required=True, + help='States of the vehicle') + start_date = fields.Date( + string='Start Date', required=True, default=fields.Date.context_today, + help='Start date to filter the records') + end_date = fields.Date( + string='End Date', default=fields.Date.context_today, + help='End date to filter the records') + exclude_vehicle_data = fields.Boolean( + string='Exclude Vehicle Data', default=True, + help='Enable this to hide the vehicle data in the report') + + @api.onchange('start_date') + def _onchange_start_date(self): + """ + set valid start_date on changing it + """ + if not self.end_date: + if self.start_date and self.start_date > fields.Date.context_today( + self): + self.start_date = fields.Date.context_today(self) + else: + if self.start_date and self.start_date > self.end_date: + self.start_date = self.end_date + + @api.onchange('end_date') + def _onchange_end_date(self): + """ + set valid end_date on changing it + """ + if self.start_date and self.end_date and \ + self.start_date > self.end_date: + self.end_date = self.start_date + if self.end_date and self.end_date > fields.Date.context_today(self): + self.end_date = fields.Date.context_today(self) + + @api.onchange('state_ids') + def _onchange_state_ids(self): + """ + filter the vehicle_ids on changing the state_ids + """ + if self.state_ids: + self.vehicle_ids = self.vehicle_ids.filtered( + lambda vehicle: vehicle.state_id.id in self.state_ids.ids) + + def action_print_report(self): + """ + print PDF report for fleet based on selected data + :return: report action + """ + vehicles = self.vehicle_ids + if not self.vehicle_ids: + if self.state_ids: + vehicles = self.env['fleet.vehicle'].search( + [('state_id', 'in', self.state_ids.ids)]) + else: + vehicles = self.env['fleet.vehicle'].search([]) + data = {'vehicle_ids': vehicles.ids} + return self.env.ref( + 'fleet_complete_report.action_report_vehicle_detail').report_action( + self, data=data) diff --git a/fleet_complete_report/wizard/vehicle_detail_views.xml b/fleet_complete_report/wizard/vehicle_detail_views.xml new file mode 100644 index 000000000..f32006145 --- /dev/null +++ b/fleet_complete_report/wizard/vehicle_detail_views.xml @@ -0,0 +1,46 @@ + + + + + vehicle.detail.view.form + vehicle.detail + +
+ + + + + + + + + + + +
+
+
+
+
+ + + + Vehicle Details + vehicle.detail + ir.actions.act_window + form + + new + + + + +
\ No newline at end of file