diff --git a/fleet_vehicle_inspection_management/README.rst b/fleet_vehicle_inspection_management/README.rst new file mode 100644 index 000000000..c5e6e6dcd --- /dev/null +++ b/fleet_vehicle_inspection_management/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 + +Vehicle Inspection Management in Fleet +======================================= +* Vehicle Inspection Management used to manage the Fleet Inspection and Services, User can add real time images for service. + +Configuration +============= +- Install our custom addon +- No additional Configuration needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V14)Mohamed Muzammil VP, 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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/fleet_vehicle_inspection_management/__init__.py b/fleet_vehicle_inspection_management/__init__.py new file mode 100644 index 000000000..036ebb62c --- /dev/null +++ b/fleet_vehicle_inspection_management/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 models +from . import wizard diff --git a/fleet_vehicle_inspection_management/__manifest__.py b/fleet_vehicle_inspection_management/__manifest__.py new file mode 100644 index 000000000..7624a40a3 --- /dev/null +++ b/fleet_vehicle_inspection_management/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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': 'Vehicle Inspection Management in Fleet', + 'version': '14.0.1.0.0', + 'category': 'Industries', + 'summary': 'Vehicle Inspection Management for manage the Vehicle', + 'description': 'Vehicle Inspection Management used to manage the Fleet ' + 'Inspection and Services, User can add real time images ' + 'for service', + 'depends': ['base', 'fleet'], + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'data': { + 'security/fleet_vehicle_inspection_management_security.xml', + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'data/ir_cron_data.xml', + 'data/mail_template_data.xml', + 'views/vehicle_inspection_views.xml', + 'views/inspection_request_views.xml', + 'views/fleet_vehicle_views.xml', + 'views/fleet_vehicle_log_services_views.xml', + 'views/vehicle_service_log_views.xml', + 'report/vehicle_service_log_reports.xml', + 'report/vehicle_service_log_templates.xml', + 'wizard/fleet_service_inspection_views.xml', + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/fleet_vehicle_inspection_management/data/ir_cron_data.xml b/fleet_vehicle_inspection_management/data/ir_cron_data.xml new file mode 100644 index 000000000..47354ecae --- /dev/null +++ b/fleet_vehicle_inspection_management/data/ir_cron_data.xml @@ -0,0 +1,18 @@ + + + + + + Vehicle inspection Request + + code + model.action_create_inspection_request() + + + 1 + days + -1 + 1 + + + diff --git a/fleet_vehicle_inspection_management/data/ir_sequence_data.xml b/fleet_vehicle_inspection_management/data/ir_sequence_data.xml new file mode 100644 index 000000000..33485b834 --- /dev/null +++ b/fleet_vehicle_inspection_management/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + Vehicle Inspection Request + inspection.request + INSP/REQ + 5 + + + + + + diff --git a/fleet_vehicle_inspection_management/data/mail_template_data.xml b/fleet_vehicle_inspection_management/data/mail_template_data.xml new file mode 100644 index 000000000..f08220960 --- /dev/null +++ b/fleet_vehicle_inspection_management/data/mail_template_data.xml @@ -0,0 +1,56 @@ + + + + + + Vehicle Inspection Notification Email + {{object.user_id.company_id.email}} + + {{object.name}} - + {{object.inspection_id.name}} + + + {{object.user_id.email}} + + +

Dear, +

+
    This Email is about Vehicle Inspection Notification as + below: + +
    + + + + + + + + + + + + + + + +
    VehicleModelLicense Plate
    + + + + + +
    +
    +
    +

    +

+ +

Thank you,

+
+
+
+
+
diff --git a/fleet_vehicle_inspection_management/doc/RELEASE_NOTES.md b/fleet_vehicle_inspection_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9f4ba95c4 --- /dev/null +++ b/fleet_vehicle_inspection_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 22.12.2023 +#### Version 14.0.1.0.0 +#### ADD +- Initial commit for Vehicle Inspection Management in Fleet diff --git a/fleet_vehicle_inspection_management/models/__init__.py b/fleet_vehicle_inspection_management/models/__init__.py new file mode 100644 index 000000000..c485cbcf2 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/__init__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 fleet_sub_service_type +from . import fleet_vehicle +from . import fleet_vehicle_log_services +from . import inspection_image +from . import inspection_request +from . import inspection_request_line +from . import vehicle_inspection +from . import vehicle_service_log diff --git a/fleet_vehicle_inspection_management/models/fleet_sub_service_type.py b/fleet_vehicle_inspection_management/models/fleet_sub_service_type.py new file mode 100644 index 000000000..475574291 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/fleet_sub_service_type.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 FleetSubServiceTypes(models.Model): + """Model for create service wizard""" + _name = 'fleet.sub.service.type' + _description = 'Fleet Sub Service Type' + _rec_name = 'service_category' + + service_type_id = fields.Many2one('fleet.service.type', + help='Vehicle service type', + string='Vehicle service type') + service_category = fields.Char(string='Category', + help='Vehicle service category',) + + @api.onchange('service_type_id') + def _onchange_service_type_id(self): + """Select service category """ + for rec in self: + rec.service_category = rec.service_type_id.category diff --git a/fleet_vehicle_inspection_management/models/fleet_vehicle.py b/fleet_vehicle_inspection_management/models/fleet_vehicle.py new file mode 100644 index 000000000..724f36316 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/fleet_vehicle.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 FleetVehicleInherit(models.Model): + """ Inherit model and add inspection lines""" + _inherit = 'fleet.vehicle' + + inspection_line_ids = fields.One2many('inspection.request.line', + 'fleet_vehicle_id', + string='Inspection Line', + help='Vehicle Inspection Lines') + is_inspection_active = fields.Boolean(string='Inspection active', + help='Active Vehicle Inspection', + default=False) + inspection_count = fields.Integer(string='Inspections', + help='Number of inspections', + compute='_compute_inspection_count') + + def get_inspection_requests(self): + """Inspection smart button""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Vehicle Inspections', + 'view_mode': 'tree,form', + 'res_model': 'inspection.request', + 'domain': [('vehicle_id', '=', self.id)]} + + @api.depends('is_inspection_active') + def _compute_inspection_count(self): + """ Calculating the vehicle inspection number """ + self.inspection_count = self.env['inspection.request'].search_count( + [('vehicle_id', '=', self.id)]) diff --git a/fleet_vehicle_inspection_management/models/fleet_vehicle_log_services.py b/fleet_vehicle_inspection_management/models/fleet_vehicle_log_services.py new file mode 100644 index 000000000..a12c05980 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/fleet_vehicle_log_services.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 FleetVehicleLogServices(models.Model): + """Inherit fleet service add sub service types""" + _inherit = 'fleet.vehicle.log.services' + + fleet_service_id = fields.Many2one( + 'fleet.vehicle.log.services', help='Fleet service', + string='Fleet service') + sub_service_ids = fields.One2many( + 'fleet.service.inspection', 'service_id', help='Sub Service Lines', + string='Sub Service Lines') + inspection_reference_id = fields.Many2one( + 'fleet.vehicle.log.services', string='Inspection Reference', + help='Inspection Reference') + inspection_name = fields.Char( + string='Inspection', help='Vehicle Inspection name') diff --git a/fleet_vehicle_inspection_management/models/inspection_image.py b/fleet_vehicle_inspection_management/models/inspection_image.py new file mode 100644 index 000000000..dafb891e8 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_image.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 InspectionImages(models.Model): + """Model to add inspection images""" + _name = 'inspection.image' + _description = 'Inspection Images' + + name = fields.Char(String='Image Name', help='Image name') + image = fields.Image(string='Image', help='Inspection Image') + inspection_req_id = fields.Many2one('inspection.request', + help='Vehicle inspection', + string='Vehicle inspection') + service_log_id = fields.Many2one('vehicle.service.log', help='Service log', + string='Service log') diff --git a/fleet_vehicle_inspection_management/models/inspection_request.py b/fleet_vehicle_inspection_management/models/inspection_request.py new file mode 100644 index 000000000..387eee004 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_request.py @@ -0,0 +1,203 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 datetime import timedelta +from odoo import api, fields, models + + +class InspectionRequests(models.Model): + """Create inspection requests""" + _name = 'inspection.request' + _description = 'Inspection Request' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char( + readonly=True, help='Inspection Request name', + string='Inspection Request name') + inspection_id = fields.Many2one( + 'vehicle.inspection', required=True, help='Select Vehicle Inspection', + string='Select Vehicle Inspection') + vehicle_id = fields.Many2one( + 'fleet.vehicle', string='Vehicle', required=True, + help='Select Vehicle for inspection') + vehicle_model_id = fields.Many2one( + 'fleet.vehicle.model', string='Model', related="vehicle_id.model_id", + help='Vehicle model', store=True) + license_plate = fields.Char( + string='License Plate', readonly=False, + related="vehicle_id.license_plate", help='vehicle license plate') + date_create = fields.Date( + default=lambda self: fields.Date.today(), + string='Inspection Create Date', help='Inspection Create Date',) + inspection_date = fields.Date( + default=lambda self: fields.Date.today(), string='Inspection Date', + help='Vehicle inspection date',) + user_id = fields.Many2one( + 'res.users', string='Inspection Supervisor', readonly=False, + related='inspection_id.user_id', help='Inspection supervisor') + company_id = fields.Many2one( + 'res.company', string='Company', help='Company', + default=lambda self: self.env.company) + image_128 = fields.Image( + related='vehicle_model_id.image_128', help='Vehicle Image', + string='Image') + inspection_result = fields.Char( + string='Inspection Result', help='Vehicle inspection result') + internal_note = fields.Html(string='Internal Note', help='Internal note') + state = fields.Selection( + selection=[('draft', 'Draft'), ('new', 'New'), + ('inspection_started', 'Inspection Started'), + ('inspection_finished', 'Inspection Finished')], + default='draft', copy=False, tracking=True, + help='Status of Inspection', string='Status of Inspection') + inspection_image_ids = fields.One2many( + 'inspection.image', 'inspection_req_id', + help='Add Inspection Images', string='Add Inspection Images') + inspection_line_reference_id = fields.Many2one( + 'inspection.request', + string='Inspection Reference', help='Inspection Line') + service_reference_id = fields.Many2one( + 'inspection.request', string='Service Reference', + help='Service Reference') + service_active = fields.Boolean( + string='Service active', default=False, + help='Active Service smart button', compute='_compute_service_active') + fleet_active = fields.Boolean( + string='Service active', default=False, + help='Active Service smart button', compute='_compute_fleet_active') + + @api.model + def create(self, vals): + """Generate vehicle inspection sequence""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'inspection.request') or 'New' + return super(InspectionRequests, self, ).create(vals) + + @api.depends('service_active') + def _compute_service_active(self): + """Checking if any service is created or not""" + self.service_active = self.env[ + 'fleet.service.inspection'].search_count( + [('inspection_reference_id', '=', self.id)]) != 0 + + @api.depends('fleet_active') + def _compute_fleet_active(self): + """Checking that vehicle is chosen or not""" + self.fleet_active = bool(self.vehicle_id) + + def action_confirm_inspection(self): + """Button to confirm inspection request""" + self.write({'state': 'new'}) + inspection_request_line = self.env['inspection.request.line'].search([ + ('inspection_request_reference_id', '=', self.id) + ]) + if not inspection_request_line: + self.env['inspection.request.line'].create({ + 'fleet_vehicle_id': self.vehicle_id.id, + 'description': self.inspection_id.name, + 'inspection_id': self.inspection_id.id, + 'inspection_period': self.inspection_id.inspection_period, + 'reminder_notification': + self.inspection_id.reminder_notification_days, + 'user_id': self.user_id, + 'next_inspection_date': self.inspection_date, + }) + + def action_print_report(self): + """ Print pdf report""" + images = [] + for rec in self.inspection_image_ids: + images.append(rec.image) + data = { + 'logo': self.vehicle_id.model_id.image_128, + 'vehicle_model_id': self.vehicle_id.model_id.name, + 'records': self.read(), + 'license_plate': self.vehicle_id.license_plate, + 'user_id': self.user_id.name, + 'images': images,} + return self.env.ref( + 'fleet_vehicle_inspection_management.' + 'action_report_vehicle_inspection').report_action(self, data=data) + + def action_start_inspection(self): + """Button to start vehicle inspection""" + self.write({'state': 'inspection_started'}) + + def action_finish_inspection(self): + """Button to make inspection finished""" + self.write({'state': 'inspection_finished'}) + + def action_create_service(self): + """Opens wizard to create service""" + if not self.service_reference_id: + service_id = self.env['fleet.service.inspection'].create({ + 'inspection_reference_id': self.id, + 'vehicle_id': self.vehicle_id.id}) + self.service_reference_id = service_id.id + return { + 'name': 'Create Service', + 'type': 'ir.actions.act_window', + 'res_model': 'fleet.service.inspection', + 'view_mode': 'form', + 'target': 'new', + 'res_id': self.service_reference_id.id} + + def action_create_inspection_request(self): + """Automatically create inspection request and send reminder email""" + for lines in self.env['inspection.request.line'].search([]): + reminder_day = lines.next_inspection_date - timedelta( + days=lines.reminder_notification) + if reminder_day == fields.Date.today(): + self.write({'state': 'new'}) + lines.inspection_request_reference_id = self.inspection_line_reference_id.id + next_inspection = lines.next_inspection_date + timedelta( + days=lines.inspection_period) + lines.last_inspection_date = lines.next_inspection_date + lines.next_inspection_date = next_inspection + mail_template_id = self.env.ref( + 'fleet_vehicle_inspection_management.' + 'vehicle_inspection_reminder_email_template') + mail_template_id.send_mail( + self.inspection_line_reference_id.id) + + def get_vehicle_service(self): + """Vehicle service smart button""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Vehicle Service log', + 'view_mode': 'tree,form', + 'context': {'create': False}, + 'res_model': 'vehicle.service.log', + 'domain': [('service_reference_id', '=', self.env[ + 'fleet.service.inspection'].search( + [('inspection_reference_id', '=', self.id)]).id)]} + + def get_fleet_vehicle(self): + """Fleet vehicle smart button""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Fleet Vehicle', + 'view_mode': 'tree,form', + 'res_model': 'fleet.vehicle', + 'domain': [('id', '=', self.vehicle_id.id)]} diff --git a/fleet_vehicle_inspection_management/models/inspection_request_line.py b/fleet_vehicle_inspection_management/models/inspection_request_line.py new file mode 100644 index 000000000..a6a85c2a3 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_request_line.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 . +# +############################################################################### +""" model for vehicle inspection lines""" +from odoo import fields, models + + +class InspectionRequestLine(models.Model): + """ add inspection requests """ + _name = 'inspection.request.line' + _description = 'Inspection Request Line' + _rec_name = 'fleet_vehicle_id' + + fleet_vehicle_id = fields.Many2one( + 'fleet.vehicle', string='Vehicle', + help='Select vehicle for the inspection request.') + description = fields.Char(string='Description', + help='Description for inspection request') + inspection_id = fields.Many2one('vehicle.inspection', required=True, + help='Select vehicle inspection', + string='Inspection Reference') + inspection_period = fields.Integer( + string='Period(Days)', related='inspection_id.inspection_period', + help='Recurring interval of vehicle inspection') + reminder_notification = fields.Integer( + string='Reminder Notification Date', + related='inspection_id.reminder_notification_days', + help='Number of days before need to send Reminder Email') + user_id = fields.Many2one('res.users', string='Inspection Supervisor', + related='inspection_id.user_id', + help='Instruction Supervisor') + last_inspection_date = fields.Date(string='Last Inspection Date', + help='Date of last inspection ') + next_inspection_date = fields.Date(string='Next Inspection Date', + help='Date of next inspection') + inspection_request_reference_id = fields.Many2one( + 'inspection.request.line', string='Inspection Request Reference', + help='Inspection Request Reference') diff --git a/fleet_vehicle_inspection_management/models/vehicle_inspection.py b/fleet_vehicle_inspection_management/models/vehicle_inspection.py new file mode 100644 index 000000000..537e7b451 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/vehicle_inspection.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 VehicleInspection(models.Model): + """ Add vehicle inspections """ + _name = 'vehicle.inspection' + _description = 'Vehicle Inspection' + + name = fields.Char(string='Name', help='Name of vehicle inspection', + required=True) + inspection_period = fields.Integer( + string='Period(Days)', help='Recurring period of vehicle inspection') + reminder_notification_days = fields.Integer( + string='Reminder Notification(Days)', + help='Number of days before want to send reminder email') + user_id = fields.Many2one('res.users', string='Inspection Supervisor', + helps='Inspection supervisor', required=True) + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company, + help='Company Name') diff --git a/fleet_vehicle_inspection_management/models/vehicle_service_log.py b/fleet_vehicle_inspection_management/models/vehicle_service_log.py new file mode 100644 index 000000000..4b35007d1 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/vehicle_service_log.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 . +# +############################################################################### +""" vehicle inspection and service details""" +from odoo import fields, models + + +class VehicleServiceLog(models.Model): + """ add vehicle inspection details""" + _name = 'vehicle.service.log' + _description = 'Vehicle Service Log' + _inherit = 'fleet.vehicle.log.services' + + service_image_ids = fields.One2many('inspection.image', 'service_log_id', + help='Inspection Images', + string='Inspection Images') + additional_service_ids = fields.One2many('fleet.service.inspection', + 'service_log_id', + help='Additional Services', + string='Additional Services') + inspection_result = fields.Char(string='Inspection Result', + help='Result of inspection') + notes = fields.Html(string='Internal Notes', help='Internal notes') + service_reference_id = fields.Many2one( + 'vehicle.service.log', string='Service Reference', + help='Service Reference') diff --git a/fleet_vehicle_inspection_management/report/vehicle_service_log_reports.xml b/fleet_vehicle_inspection_management/report/vehicle_service_log_reports.xml new file mode 100644 index 000000000..0a35a7d06 --- /dev/null +++ b/fleet_vehicle_inspection_management/report/vehicle_service_log_reports.xml @@ -0,0 +1,11 @@ + + + + + Vehicle Inspection Report + vehicle.service.log + qweb-pdf + fleet_vehicle_inspection_management.report_vehicle_inspection + fleet_vehicle_inspection_management.report_vehicle_inspection + + diff --git a/fleet_vehicle_inspection_management/report/vehicle_service_log_templates.xml b/fleet_vehicle_inspection_management/report/vehicle_service_log_templates.xml new file mode 100644 index 000000000..8256704ac --- /dev/null +++ b/fleet_vehicle_inspection_management/report/vehicle_service_log_templates.xml @@ -0,0 +1,114 @@ + + + + + diff --git a/fleet_vehicle_inspection_management/security/fleet_vehicle_inspection_management_security.xml b/fleet_vehicle_inspection_management/security/fleet_vehicle_inspection_management_security.xml new file mode 100644 index 000000000..da30e3cf0 --- /dev/null +++ b/fleet_vehicle_inspection_management/security/fleet_vehicle_inspection_management_security.xml @@ -0,0 +1,52 @@ + + + + + Vehicle Inspection Management + User access level for Vehicle Inspection + module + + 20 + + + + Inspection Supervisor + + + + + Inspection Manager + + + + + + + Inspection Supervisor Rule + + [('user_id', '=', user.id)] + + + + + Inspection Manager Rule + + [(1, '=', 1)] + + + + + Inspection Request Company Rule + + [('company_id', '=', company_id)] + + + + Vehicle Inspection Company Rule + + [('company_id', '=', company_id)] + + diff --git a/fleet_vehicle_inspection_management/security/ir.model.access.csv b/fleet_vehicle_inspection_management/security/ir.model.access.csv new file mode 100644 index 000000000..426a01346 --- /dev/null +++ b/fleet_vehicle_inspection_management/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_vehicle_inspection,vehicle.inspection,model_vehicle_inspection,base.group_user,1,1,1,1 +access_inspection_request,inspection.request,model_inspection_request,base.group_user,1,1,1,1 +access_inspection_image,inspection.image,model_inspection_image,base.group_user,1,1,1,1 +access_inspection_request_line,inspection.request.line,model_inspection_request_line,base.group_user,1,1,1,1 +access_fleet_service_inspection,fleet.service.inspection,model_fleet_service_inspection,base.group_user,1,1,1,1 +access_fleet_sub_service_type,fleet.sub.service.type,model_fleet_sub_service_type,base.group_user,1,1,1,1 +access_vehicle_service_log,vehicle.service.log,model_vehicle_service_log,base.group_user,1,1,1,1 diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/check.png b/fleet_vehicle_inspection_management/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/check.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/chevron.png b/fleet_vehicle_inspection_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/chevron.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/cogs.png b/fleet_vehicle_inspection_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/cogs.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/consultation.png b/fleet_vehicle_inspection_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/consultation.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/ecom-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/ecom-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/education-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/education-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/hotel-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/hotel-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/license.png b/fleet_vehicle_inspection_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/license.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/lifebuoy.png b/fleet_vehicle_inspection_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/lifebuoy.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/manufacturing-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/pos-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/pos-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/puzzle.png b/fleet_vehicle_inspection_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/puzzle.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/restaurant-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/restaurant-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/service-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/service-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/trading-black.png b/fleet_vehicle_inspection_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/trading-black.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/training.png b/fleet_vehicle_inspection_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/training.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/update.png b/fleet_vehicle_inspection_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/update.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/user.png b/fleet_vehicle_inspection_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/user.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/icons/wrench.png b/fleet_vehicle_inspection_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/icons/wrench.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/categories.png b/fleet_vehicle_inspection_management/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/categories.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/check-box.png b/fleet_vehicle_inspection_management/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/check-box.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/compass.png b/fleet_vehicle_inspection_management/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/compass.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/corporate.png b/fleet_vehicle_inspection_management/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/corporate.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/customer-support.png b/fleet_vehicle_inspection_management/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/customer-support.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/cybrosys-logo.png b/fleet_vehicle_inspection_management/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/cybrosys-logo.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/features.png b/fleet_vehicle_inspection_management/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/features.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/logo.png b/fleet_vehicle_inspection_management/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/logo.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/pictures.png b/fleet_vehicle_inspection_management/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/pictures.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/pie-chart.png b/fleet_vehicle_inspection_management/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/pie-chart.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/right-arrow.png b/fleet_vehicle_inspection_management/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/right-arrow.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/star.png b/fleet_vehicle_inspection_management/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/star.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/support.png b/fleet_vehicle_inspection_management/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/support.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp.png b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/1.png b/fleet_vehicle_inspection_management/static/description/assets/modules/1.png new file mode 100644 index 000000000..49e3b5934 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/1.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/2.jpg b/fleet_vehicle_inspection_management/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..43123c0e2 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/2.jpg differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/3.png b/fleet_vehicle_inspection_management/static/description/assets/modules/3.png new file mode 100644 index 000000000..a428db2e1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/3.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/4.png b/fleet_vehicle_inspection_management/static/description/assets/modules/4.png new file mode 100644 index 000000000..50a1ff4b8 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/4.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/5.png b/fleet_vehicle_inspection_management/static/description/assets/modules/5.png new file mode 100644 index 000000000..a0a3c01c6 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/5.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/6.png b/fleet_vehicle_inspection_management/static/description/assets/modules/6.png new file mode 100644 index 000000000..730fb36f4 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/6.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/1.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..98b85e53c Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/1.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/10.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..afe249e80 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/10.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/11.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..42356542f Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/11.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/12.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..dd99f70fc Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/12.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/13.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..54ad16fba Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/13.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/14.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..ebe9a3e34 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/14.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/15.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..4e3a1296c Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/15.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/16.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..9744f2b17 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/16.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/17.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..b3d6ae7ce Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/17.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/18.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..f3b5fa006 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/18.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/19.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..12e8a9769 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/19.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/2.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..e3c3e645d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/2.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/20.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..0e852081b Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/20.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/21.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..caeb9948a Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/21.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/22.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..7aa8f23cd Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/22.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/23.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/23.png new file mode 100644 index 000000000..2bb19ef28 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/23.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/24.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/24.png new file mode 100644 index 000000000..bac1921d1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/24.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/3.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..1ef459716 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/3.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/4.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6121f4952 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/4.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/5.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..420dd4696 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/5.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/6.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..af6586933 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/6.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/7.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..fb68026eb Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/7.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/8.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..16021e541 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/8.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/9.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..fa1621d0c Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/9.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/hero.gif b/fleet_vehicle_inspection_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..625fb6d91 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/hero.gif differ diff --git a/fleet_vehicle_inspection_management/static/description/banner.jpg b/fleet_vehicle_inspection_management/static/description/banner.jpg new file mode 100644 index 000000000..e31f63d7b Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/banner.jpg differ diff --git a/fleet_vehicle_inspection_management/static/description/icon.png b/fleet_vehicle_inspection_management/static/description/icon.png new file mode 100644 index 000000000..bb7d95d31 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/icon.png differ diff --git a/fleet_vehicle_inspection_management/static/description/index.html b/fleet_vehicle_inspection_management/static/description/index.html new file mode 100644 index 000000000..0b2c2fe00 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/index.html @@ -0,0 +1,777 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Vehicle Inspection Management in Fleet. +

+

+ Manage Recurring Inspection of vehicles or fleets. +

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

+ Explore This + Module +

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ The Fleet Vehicle Inspection Management app streamlines vehicle maintenance by + allowing users to schedule and conduct inspections. It ensures safety and + compliance by recording inspection results, identifying issues, and generating + services. This comprehensive solution enhances fleet management efficiency + while prioritizing driver and vehicle safety. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + Option to create and manage vehicle inspection on vehicle form view. +
+
+ + Option to set up and manage different inspections. +
+
+ + Recurring Vehicle Inspections. +
+
+ + Option to send Automatic Vehicle Inspection Reminder Email. + +
+
+ + Option to create vehicle service from Inspection Request. + +
+
+ + Option to Print Vehicle Inspection PDF Report. +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Vehicle Inspection Management User Access +

+

+ Go to Settings -> User & Companies + -> + Users. There has two user access 'Inspection Manager' and + 'Inspection Supervisor'. +

+ +
+
+

+ Vehicle Inspection +

+

+ Can see Vehicle Inspection under Configuration. +

+ +
+
+

+ Vehicle Inspection +

+

+ We Can create Vehicle Inspection +

+ +
+
+

+ Create Inspection Requests +

+

+ In Fleet, We have Inspection Request menu +

+ +

+ In Inspection Requests, We Can create inspection requests, and + we can see created requests in tree view +

+ +

+ Fill inspection type vehicle, model, license plate etc.. +

+ +

+ Then click on START INSPECTION button to start inspection +

+ +

+ If the inspection finished click on FINISH INSPECTION button, +

+

+ We can add inspection information in given fields +

+ +

+ We can add Inspection Images in the marked tab. +

+ +

+ We can create service type by Clicking on CREATE SERVICE + button. +

+ +

+ In the wizard fill information about the service. +

+ +

+ Click on Service smart button to see the services created. +

+ +

+

+ +
+
+

+ Form View of service +

+ +
+
+

+ Open a Vehicle record in Fleet +

+

+ Enable Inspection Active field, which activate inspection lines + Page in Notebook, can see the created Inspections for that vehicle +

+ +
+
+

+ Fleet --> Services +

+

+ We can see the service menu open it. +

+ +
+
+

+ Can see the all service created in tree view. Can create a service from there +

+ +
+
+

+ Form view of service +

+ +
+
+

+ Inspection Request --> Started Inspection +

+

+ We can see inspection in ongoing state. +

+ +
+
+

+ We can see finished inspection +

+ +
+
+

+ Click on PDF REPORT button to print pdf report. +

+ +
+
+

+ PDF Report +

+

+ Can see report with Images added +

+ +
+
+

+ Reminder +

+

+ Sent automatic reminder before one day to the Inspection Supervisor. +

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

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 +

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

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

+ +

+ odoo@cybrosys.com +

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707 +

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/fleet_vehicle_inspection_management/views/fleet_vehicle_log_services_views.xml b/fleet_vehicle_inspection_management/views/fleet_vehicle_log_services_views.xml new file mode 100644 index 000000000..a41453977 --- /dev/null +++ b/fleet_vehicle_inspection_management/views/fleet_vehicle_log_services_views.xml @@ -0,0 +1,25 @@ + + + + + + fleet.service.log.view.form.inherit.fleet.vehicle.inspection.management + + fleet.vehicle.log.services + + + +
+ + + + + + +
+
+
+
+
diff --git a/fleet_vehicle_inspection_management/views/fleet_vehicle_views.xml b/fleet_vehicle_inspection_management/views/fleet_vehicle_views.xml new file mode 100644 index 000000000..d027e4fd6 --- /dev/null +++ b/fleet_vehicle_inspection_management/views/fleet_vehicle_views.xml @@ -0,0 +1,45 @@ + + + + + + fleet.vehicle.view.form.inherit.fleet.vehicle.inspection.management + + fleet.vehicle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fleet_vehicle_inspection_management/views/inspection_request_views.xml b/fleet_vehicle_inspection_management/views/inspection_request_views.xml new file mode 100644 index 000000000..c60534004 --- /dev/null +++ b/fleet_vehicle_inspection_management/views/inspection_request_views.xml @@ -0,0 +1,304 @@ + + + + + Inspection Requests + ir.actions.act_window + inspection.request + tree,form,kanban,calendar + +

+ Create a new record! +

+
+
+ + Started Inspections + ir.actions.act_window + inspection.request + tree,form,kanban,calendar + [('state','=','inspection_started')] + {'create': False} + +

+ Create a new record! +

+
+
+ + + Finished Inspections + ir.actions.act_window + inspection.request + tree,form,kanban,calendar + [('state','=','inspection_finished')] + {'create': False} + +

+ Create a new record! +

+
+
+ + + + + + + + inspection.request.view.form + inspection.request + +
+
+ +
+ +
+ + +
+ +
+

+ + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + +
+
+
+
+
+
+
+ + + + + + + + +
+
+
+
+
+ + + +
+ +
+
+ + + inspection.request.view.tree + inspection.request + + + + + + + + + + + + + + + + + inspection.request.view.kanban + inspection.request + + + + +
+
+
+
+ + + +
+
+ + Vehicle: + + +
+
+ + Model: + + +
+
+ + Inspection Supervisor: + + +
+
+ + Inspection Date: + + +
+
+
+
+
+
+
+
+
+ + + inspection.request.view.calendar + inspection.request + + + + + + + + + + + + + + inspection.request.view.search + inspection.request + + + + + + + + + + + +
diff --git a/fleet_vehicle_inspection_management/views/vehicle_inspection_views.xml b/fleet_vehicle_inspection_management/views/vehicle_inspection_views.xml new file mode 100644 index 000000000..ff0b60e8e --- /dev/null +++ b/fleet_vehicle_inspection_management/views/vehicle_inspection_views.xml @@ -0,0 +1,36 @@ + + + + + Vehicle Inspection + ir.actions.act_window + vehicle.inspection + tree,kanban + +

+ Create a new record! +

+
+
+ + + + + + vehicle.inspection.view.tree + vehicle.inspection + + + + + + + + + + +
diff --git a/fleet_vehicle_inspection_management/views/vehicle_service_log_views.xml b/fleet_vehicle_inspection_management/views/vehicle_service_log_views.xml new file mode 100644 index 000000000..1b9bb3d8f --- /dev/null +++ b/fleet_vehicle_inspection_management/views/vehicle_service_log_views.xml @@ -0,0 +1,118 @@ + + + + + Vehicle Service Logs + ir.actions.act_window + vehicle.service.log + tree,form,kanban + +

+ Create a new record! +

+
+
+ + + vehicle.service.log.view.form + vehicle.service.log + +
+ + + + + + + + + + + + + + + +

Additional Services

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + +
+ +
+
+
+
+
+
+ + + + + + + + + +
+
+
+
+ +
+
+ + + vehicle.service.log.view.tree + vehicle.service.log + + + + + + + + + + +
diff --git a/fleet_vehicle_inspection_management/wizard/__init__.py b/fleet_vehicle_inspection_management/wizard/__init__.py new file mode 100644 index 000000000..c707c9f8b --- /dev/null +++ b/fleet_vehicle_inspection_management/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 fleet_service_inspection diff --git a/fleet_vehicle_inspection_management/wizard/fleet_service_inspection.py b/fleet_vehicle_inspection_management/wizard/fleet_service_inspection.py new file mode 100644 index 000000000..619d9883b --- /dev/null +++ b/fleet_vehicle_inspection_management/wizard/fleet_service_inspection.py @@ -0,0 +1,140 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP(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 FleetServiceInspection(models.TransientModel): + """ Create a vehicle service model""" + _name = 'fleet.service.inspection' + _description = 'Fleet Service' + + service_subtype_ids = fields.Many2many( + 'fleet.service.type', string='Sub service Type', + help='Related filed for the sub service type') + inspection_reference_id = fields.Many2one( + 'inspection.request', string='Inspection ID', help='Inspection Id') + service_type_id = fields.Many2one( + 'fleet.service.type', string='Services', help='Services') + service_id = fields.Many2one('fleet.vehicle.log.services', + help='Service Reference', + string='Service Reference') + service_log_id = fields.Many2one('vehicle.service.log', + help='Service log Reference', + string='Service log Reference') + service_category = fields.Selection( + selection=[('service', 'Service'), ('contract', 'Contract'), ], + help='Service Category type.', string='Service Category') + vehicle_id = fields.Many2one('fleet.vehicle', help='Vehicle', + string='Vehicle') + odometer = fields.Float(string='Last Odometer', + help='Odometer measure of the vehicle at the ' + 'moment of this log') + odometer_unit = fields.Selection( + selection=[('kilometers', 'km'), ('miles', 'mi')], + string='Odometer Unit', default='kilometers', required=True, + help='Odometer reading') + sub_service_reference_id = fields.Many2one( + 'fleet.service.inspection', string='Sub Services', + help='Vehicle sub service') + log_sub_service_id = fields.Many2one('fleet.service.inspection', + string='Sub Services', + help='Vehicle sub service') + amount = fields.Monetary(string='Cost', help='Amount',) + date = fields.Date(string='Vehicle Service Date', + help='Vehicle Service Date',) + company_id = fields.Many2one('res.company', string='Company', + help='Company', + default=lambda self: self.env.company) + currency_id = fields.Many2one('res.currency', + related='company_id.currency_id', + string='Currency', help='Currency') + vendor_id = fields.Many2one('res.partner', string='Vendor', help='Vendor') + + @api.onchange('service_type_id') + def _onchange_service_category(self): + """Function to service category """ + for rec in self: + rec.service_category = rec.service_type_id.category + + def action_create_service(self): + """Create vehicle service""" + if not self.service_id: + self.env['fleet.vehicle.log.services'].create({ + 'inspection_reference_id': self.id, + 'description': self.inspection_reference_id.inspection_id.name, + 'service_type_id': self.service_type_id.id, + 'date': fields.Date.today(), + 'vehicle_id': self.vehicle_id.id, + 'odometer': self.odometer, + 'sub_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'sub_service_reference_id': rec.id, + 'service_category': rec.category, + }) for rec in self.service_subtype_ids] + })[0] + else: + for rec in self.service_subtype_ids: + if not self.sub_service_reference_id: + self.service_id.write({ + 'sub_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'sub_service_reference_id': rec.id, + 'service_category': rec.category, + })], + }) + if not self.service_log_id: + self.env['vehicle.service.log'].create({ + 'service_reference_id': self.id, + 'vehicle_id': self.vehicle_id.id, + 'service_type_id': self.service_type_id.id, + 'amount': self.amount, + 'odometer': self.odometer, + 'odometer_unit': self.odometer_unit, + 'date': self.date, + 'vendor_id': self.vendor_id, + 'inspection_name': self.inspection_reference_id.name, + 'inspection_result': self.inspection_reference_id.inspection_result, + 'notes': self.inspection_reference_id.internal_note, + 'additional_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'log_sub_service_id': rec.id, + 'service_category': rec.category, + }) for rec in self.service_subtype_ids], + 'service_image_ids': [(0, 0, { + 'name': rec.name, + 'image': rec.image, + }) for rec in self.inspection_reference_id.inspection_image_ids + ]}) + else: + for rec in self.service_subtype_ids: + if not self.log_sub_service_id: + self.service_log_id.write({ + 'additional_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'service_log_id': rec.id, + 'service_category': rec.category, + })], + }) diff --git a/fleet_vehicle_inspection_management/wizard/fleet_service_inspection_views.xml b/fleet_vehicle_inspection_management/wizard/fleet_service_inspection_views.xml new file mode 100644 index 000000000..e5dfe3759 --- /dev/null +++ b/fleet_vehicle_inspection_management/wizard/fleet_service_inspection_views.xml @@ -0,0 +1,43 @@ + + + + + fleet.service.inspection.view.form + fleet.service.inspection + +
+ + + + + + + + + +
+
+ +
+
+ + + fleet.service.inspection + ir.actions.act_window + fleet.service.inspection + form + + new + +