diff --git a/fleet_vehicle_inspection_management/README.rst b/fleet_vehicle_inspection_management/README.rst new file mode 100644 index 000000000..58bfa417a --- /dev/null +++ b/fleet_vehicle_inspection_management/README.rst @@ -0,0 +1,49 @@ +.. 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 in Fleet + +Configuration +============= +* From the user set the vehicle inspection management + +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: + (V16) Vishnu P + (V17) Anjhana A K + 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: ``__ diff --git a/fleet_vehicle_inspection_management/__init__.py b/fleet_vehicle_inspection_management/__init__.py new file mode 100644 index 000000000..ba250ce3f --- /dev/null +++ b/fleet_vehicle_inspection_management/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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 wizards diff --git a/fleet_vehicle_inspection_management/__manifest__.py b/fleet_vehicle_inspection_management/__manifest__.py new file mode 100644 index 000000000..1ceb40916 --- /dev/null +++ b/fleet_vehicle_inspection_management/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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': '17.0.1.0.0', + 'category': 'Industries', + 'summary': """Vehicle Inspection Management for managing the Vehicle + Inspection and services""", + 'description': """Efficiently organize and oversee vehicle inspections and + services with Vehicle Inspection Management system in Odoo, ensuring + optimal functionality and maintenance""", + 'depends': ['base', 'fleet'], + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.jpg'], + 'website': 'https://www.cybrosys.com', + 'data': { + 'security/vehicle_inspection_access.xml', + 'security/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', + 'wizards/fleet_service_inspection_views.xml', + 'views/fleet_vehicle_views.xml', + 'views/fleet_vehicle_log_services_views.xml', + 'views/vehicle_service_log_views.xml', + 'reports/vehicle_inspection_reports.xml', + 'reports/vehicle_inspection_report_templates.xml', + }, + '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..a8e54044b --- /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..672434e5c --- /dev/null +++ b/fleet_vehicle_inspection_management/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + Vehicle Inspection Request + inspection.request + INSPECTION/REQUEST + 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..26fa808e6 --- /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..3244dd4a7 --- /dev/null +++ b/fleet_vehicle_inspection_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.01.2024 +#### Version 17.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..301c28e2a --- /dev/null +++ b/fleet_vehicle_inspection_management/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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_inspection +from . import inspection_request +from . import inspection_images +from . import fleet_vehicle +from . import inspection_request_line +from . import vehicle_service_log 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..6812f9be5 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/fleet_vehicle.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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)]) + + +class FleetVehicleLogServicesInherit(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 = fields.Integer(string='Inspection Reference', + help='Inspection Reference') + inspection_name = fields.Char(string='Inspection', + help='Vehicle Inspection name') + + +class FleetSubServiceTypes(models.Model): + """model for create service wizard""" + _name = 'fleet.sub.service.type' + _description = 'Fleet Sub Service Type' + + 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/inspection_images.py b/fleet_vehicle_inspection_management/models/inspection_images.py new file mode 100644 index 000000000..c76431f29 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_images.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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 to add inspection images""" +from odoo import fields, models + + +class InspectionImages(models.Model): + """Model to add inspection images""" + _name = 'inspection.images' + _description = 'Inspection Images' + + name = fields.Char(String='Image Name', help='Image name') + image = fields.Binary(string='Image', help='Inspection Image') + inspection_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..a56bd03b4 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_request.py @@ -0,0 +1,238 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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 inspection requests """ +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, store=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', + help='Select Vehicle for inspection') + vehicle_model_id = fields.Many2one('fleet.vehicle.model', + string='Model', + related="vehicle_id.model_id", + readonly=False, + store=True, help='Vehicle model') + license_plate = fields.Char(string='License Plate', + related="vehicle_id.license_plate", store=True, + readonly=False, help='vehicle license plate') + date_create = fields.Date(string='Inspection Create Date', + help='Inspection Create Date', + default=lambda self: fields.Date.today()) + inspection_date = fields.Date(string='Inspection Date', + help='Vehicle inspection date', + default=lambda self: fields.Date.today()) + user_id = fields.Many2one('res.users', + string='Inspection Supervisor', + related='inspection_id.user_id', readonly=False, + store=True, 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( + [('draft', 'Draft'), + ('new', 'New'), + ('inspection_started', 'Inspection Started'), + ('inspection_finished', 'Inspection Finished'), ], + default='draft', copy=False, required=True, tracking=True, + help='Status of Inspection', string='Status of Inspection') + inspection_image_ids = fields.One2many('inspection.images', + 'inspection_id', + help='Add Inspection Images', + string='Add Inspection Images') + inspection_line_reference = fields.Integer(string='Inspection Reference', + help='Inspection Line') + service_reference = fields.Integer(string='Service Reference', + help='Service Reference') + service_active = fields.Boolean('Service active', default=False, + help='Active Service smart button', + compute='_compute_service_active') + fleet_active = fields.Boolean('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' + result = super(InspectionRequests, self, ).create(vals) + return result + + @api.depends('service_active') + def _compute_service_active(self): + """To set service active value """ + service_count = self.env['fleet.service.inspection'].search_count([ + ('inspection_reference', '=', self.id)]) + if service_count != 0: + self.service_active = True + else: + self.service_active = False + + @api.depends('fleet_active') + def _compute_fleet_active(self): + """To set fleet active value""" + if self.vehicle_id: + self.fleet_active = True + else: + self.fleet_active = False + + 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', '=', 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) + inspection_request = self.env['inspection.request'].search([ + ('name', '=', self.name) + ]) + 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': inspection_request.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: + service_id = self.env['fleet.service.inspection'].create({ + 'inspection_reference': self.id, + 'vehicle_id': self.vehicle_id.id, + 'odometer': self.vehicle_id.odometer + }) + self.service_reference = service_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, + } + + def action_create_inspection_request(self): + """automatically create inspection request and send reminder email""" + + vehicle_inspection_lines = self.env['inspection.request.line'].search( + []) + for lines in vehicle_inspection_lines: + reminder_day = lines.next_inspection_date - timedelta( + days=lines.reminder_notification) + if reminder_day == fields.Date.today(): + inspection_line_id = self.env['inspection.request'].search([ + ('inspection_line_reference', '=', lines.id)]) + if not inspection_line_id: + create_id = self.env['inspection.request'].create({ + 'inspection_id': lines.inspection_id.id, + 'inspection_line_reference': lines.id, + 'vehicle_id': lines.fleet_vehicle_id.id, + 'vehicle_model_id': lines.fleet_vehicle_id.model_id.id, + 'license_plate': lines.fleet_vehicle_id.license_plate, + 'date_create': lines.create_date, + 'inspection_date': lines.next_inspection_date, + 'user_id': lines.user_id.id, + 'company_id': self.env.company.id, + 'image_128': lines.fleet_vehicle_id.model_id.image_128, + }) + create_id.write({'state': 'new'}) + lines.inspection_request_reference = create_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(create_id.id) + + def get_vehicle_service(self): + """vehicle service smart button""" + service_id = self.env['fleet.service.inspection'].search([ + ('inspection_reference', '=', self.id)]) + 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', '=', service_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..7dcc2aee6 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/inspection_request_line.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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' + + 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 = fields.Integer( + 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..106deae16 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/vehicle_inspection.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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 create vehicle inspections""" +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') + company_id = fields.Many2one('res.company', string='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..fae572769 --- /dev/null +++ b/fleet_vehicle_inspection_management/models/vehicle_service_log.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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.images', '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 = fields.Integer(string='Service Reference', + help='Service Reference') diff --git a/fleet_vehicle_inspection_management/reports/vehicle_inspection_report_templates.xml b/fleet_vehicle_inspection_management/reports/vehicle_inspection_report_templates.xml new file mode 100644 index 000000000..452b6d470 --- /dev/null +++ b/fleet_vehicle_inspection_management/reports/vehicle_inspection_report_templates.xml @@ -0,0 +1,118 @@ + + + + + diff --git a/fleet_vehicle_inspection_management/reports/vehicle_inspection_reports.xml b/fleet_vehicle_inspection_management/reports/vehicle_inspection_reports.xml new file mode 100644 index 000000000..5aa98a884 --- /dev/null +++ b/fleet_vehicle_inspection_management/reports/vehicle_inspection_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/security/ir.model.access.csv b/fleet_vehicle_inspection_management/security/ir.model.access.csv new file mode 100644 index 000000000..d587bc9a0 --- /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_images,inspection_images,model_inspection_images,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/security/vehicle_inspection_access.xml b/fleet_vehicle_inspection_management/security/vehicle_inspection_access.xml new file mode 100644 index 000000000..81ff80b59 --- /dev/null +++ b/fleet_vehicle_inspection_management/security/vehicle_inspection_access.xml @@ -0,0 +1,22 @@ + + + + + Vehicle Inspection Management + User access level for Vehicle Inspection module + 20 + + + + Inspection Supervisor + + + + + Inspection Manager + + + + + diff --git a/fleet_vehicle_inspection_management/security/vehicle_inspection_management_security.xml b/fleet_vehicle_inspection_management/security/vehicle_inspection_management_security.xml new file mode 100644 index 000000000..d9ac24c5e --- /dev/null +++ b/fleet_vehicle_inspection_management/security/vehicle_inspection_management_security.xml @@ -0,0 +1,32 @@ + + + + + + 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)] + + \ No newline at end of file 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/Cybrosys R.png b/fleet_vehicle_inspection_management/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/misc/Cybrosys R.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/email.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/phone.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + 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 (1) 2.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + 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 (1) 1.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/support-email.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + 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/tick-mark.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp 1.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + 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/misc/whatsapp.svg b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..ba1058c42 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.png b/fleet_vehicle_inspection_management/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/2.png 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..4e506f79b 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..e78427938 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.gif b/fleet_vehicle_inspection_management/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/5.gif 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 100755 index 000000000..272ec20f9 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..7d5c3154f 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/modules/l2.png b/fleet_vehicle_inspection_management/static/description/assets/modules/l2.png new file mode 100644 index 000000000..f40a0756d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/l2.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/l3.png b/fleet_vehicle_inspection_management/static/description/assets/modules/l3.png new file mode 100644 index 000000000..5738a486e Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/l3.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/l4.png b/fleet_vehicle_inspection_management/static/description/assets/modules/l4.png new file mode 100644 index 000000000..8d99e8c68 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/l4.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/l5.png b/fleet_vehicle_inspection_management/static/description/assets/modules/l5.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/l5.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/modules/l6.png b/fleet_vehicle_inspection_management/static/description/assets/modules/l6.png new file mode 100644 index 000000000..c7ea331ee Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/modules/l6.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..2c98fc007 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/assets/screenshots/screenshot1.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..e5f29bcb2 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot1.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot10.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot10.png new file mode 100644 index 000000000..368a7bd14 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot10.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot11.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot11.png new file mode 100644 index 000000000..e7b901ecc Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot11.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot12.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot12.png new file mode 100644 index 000000000..12f6274e4 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot12.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot13.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot13.png new file mode 100644 index 000000000..c8fae689b Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot13.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot14.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot14.png new file mode 100644 index 000000000..003d65545 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot14.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot15.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot15.png new file mode 100644 index 000000000..6c9063987 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot15.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot16.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot16.png new file mode 100644 index 000000000..b8e0f3b55 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot16.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot17.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot17.png new file mode 100644 index 000000000..9635ac4e4 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot17.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot18.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot18.png new file mode 100644 index 000000000..4b0569981 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot18.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot19.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot19.png new file mode 100644 index 000000000..700d30bc1 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot19.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot2.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..111462684 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot2.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot20.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot20.png new file mode 100644 index 000000000..1d4bf3549 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot20.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot21.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot21.png new file mode 100644 index 000000000..a41b191d8 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot21.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot22.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot22.png new file mode 100644 index 000000000..c5bc3d572 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot22.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot23.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot23.png new file mode 100644 index 000000000..c0e7a1b91 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot23.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot24.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot24.png new file mode 100644 index 000000000..bbeb2c59e Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot24.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot25.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot25.png new file mode 100644 index 000000000..c948cb00d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot25.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot26.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot26.png new file mode 100644 index 000000000..f62dee1ea Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot26.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot27.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot27.png new file mode 100644 index 000000000..147bc55ba Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot27.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot28.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot28.png new file mode 100644 index 000000000..eda44a38d Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot28.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot3.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..75e9e2064 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot3.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot4.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..9e61fcded Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot4.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot5.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..e858f11ff Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot5.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot6.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..caa7c951a Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot6.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot7.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..5218d5479 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot7.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot8.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..250590f84 Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot8.png differ diff --git a/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot9.png b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot9.png new file mode 100644 index 000000000..8d651bd2b Binary files /dev/null and b/fleet_vehicle_inspection_management/static/description/assets/screenshots/screenshot9.png 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..53b053f74 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..64c192bd0 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..bb9a9fd50 --- /dev/null +++ b/fleet_vehicle_inspection_management/static/description/index.html @@ -0,0 +1,1193 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Vehicle Inspection Management in Fleet.

+

+ Manage Recurring Inspection of vehicles or fleets. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Manages Vehicle Inspection

+

This module + helps to manage Vehicle Inspection for all + vehicles or + fleets. +

+
+
+
+
+
+
+ +
+
+

+ Automatic Vehicle Inspection Reminder and + Vehicle + Inspection PDF Report

+

Send Automatic + Vehicle Inspection Reminder Email and can Print + Vehicle Inspection PDF Report +

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

+ Vehicle Inspection Management User + Access

+

+ Go to Settings -> User & Companies + -> + Users. Inside the user a field is available to add vehicle inspection management that contains two options "Inspection + Manager" and + "Inspection Supervisor". Inspection Manager can manage and see all Inspection request but Inspection Supervisor can manage and see only his/her Inspection request

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

+ Vehicle Inspection

+

+ In Fleet -> Configuration -> Vehicle + Inspection, + Can see all Vehicle Inspections,we can + create + new vehicle inspection on clicking the "New" + button

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

+ Create Inspection Requests

+

+ While creating a fleet , you will be able to + see + a field "Inspection active" on enabling it + "Inspection line" can be seen here we can + add inspections for that vehicle. +

+
+
+
+
+
+
+ + +
+
+

+ One day before the Inspection Reminder date + an + Inspection Request will be automatically + created and a Vehicle Inspection reminder + email + will be sent to the Inspection + Supervisor.

+
+
+
+
+
+
+ + +
+
+

+ Schedule Action to create next inspection + reminder and to send inspection reminder + mail

+
+
+
+
+
+
+ + +
+
+

+ Vehicle inspection reminder mail

+
+
+
+
+
+
+ + +
+
+

+ Created inspection request

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

+ In Fleet -> Inspection Request -> has + different + menus.Inspection + Request,Inspection to Start and Inspection + to + Finish.

+
+
+
+
+
+
+ + +
+
+

+ "Inspection Request" Menu shows all existing + Inspection + Requests in all state.

+
+
+
+
+
+
+ + +
+
+

+ In the Inspection request, On clicking the + "Inspection Start" button that request will + be + changed to state "Inspection Started"

+
+
+
+
+
+
+ + +
+
+

+ "Inspection to Start" Menu shows all + existing + Inspection + Requests in "Inspection Started" State.

+
+
+
+
+
+
+ + +
+
+

+ When the request attained "Inspection Start" + state,There's an option to add Inspection + Result + and Internal Note under + Inspection Information tab and also two + buttons + will be visible

+
+
+
+
+
+
+ + +
+
+

+ In the Inspection request , we can add + inspection images on clicking the add + button

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

+ On clicking the "Create Service" button a + wizard + appears where we need to provide the + necessory + details and also there's an option to add + Service types and sub service types.On + clicking + "CREATE SERVICE" button, the service will be + created. +

+
+
+
+
+
+
+ + +
+
+

+ On clicking the "Finish Inspection" button , + the + state changes to "Inspection Finished" +

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

+ "Inspection to Finish" Menu shows all + existing + Inspection + Requests in "Inspection Finished" State. +

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

+ In the inspection finish state , a button to + print pdf is available, where we can print + pdf + report for the vehicle inspection +

+
+
+
+
+
+
+ + +
+
+

+ In the inspection request, Two smart tabs + are + available for services and fleet , where we + can + view related services and fleet +

+
+
+
+
+
+
+ + +
+
+

+ Once the inspection request is created for + the + fleet and once the service is added , + inspection + request and service smart tab will be + available + in fleet +

+
+
+
+
+
+
+ + +
+
+

+ Inspection Request in Kanban View

+
+
+
+
+
+
+ + +
+
+

+ Inspection Request in Calendar View

+
+
+
+
+
+
+ + +
+
+

+ We can create Inspection Request directly by + clicking CREATE + button,but the created Inspection Request is + in + draft + state.

+
+
+
+
+
+
+ + +
+
+

+ We can change the state of Inspection + Request + into "New" by + clicking the "Confirm" button, and it will be + added into the + Inspection Lines.

+
+
+
+
+ +
+
+
    +
  • + 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. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:11th January 2024 +
+

+ + Initial Commit for Vehicle Inspection Management in Fleet.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

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

Odoo + Customization

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

Odoo + Implementation

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

Odoo + Support

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

Hire + Odoo Developer

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

Odoo + Integration

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

Odoo + Migration

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

Odoo + Consultancy

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

Odoo + Implementation

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

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/fleet_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..b177a9339 --- /dev/null +++ b/fleet_vehicle_inspection_management/views/fleet_vehicle_log_services_views.xml @@ -0,0 +1,23 @@ + + + + + + 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..0b951617c --- /dev/null +++ b/fleet_vehicle_inspection_management/views/fleet_vehicle_views.xml @@ -0,0 +1,42 @@ + + + + + + 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..ccb16e2e3 --- /dev/null +++ b/fleet_vehicle_inspection_management/views/inspection_request_views.xml @@ -0,0 +1,305 @@ + + + + + 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.calendar + inspection.request + + + + + + + + + + + + + + inspection.request.view.search + inspection.request + + + + + + + + + + + +
\ No newline at end of file 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..2114d3a5a --- /dev/null +++ b/fleet_vehicle_inspection_management/views/vehicle_inspection_views.xml @@ -0,0 +1,35 @@ + + + + + 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..797c08f05 --- /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 + + + + + + + + + + +
\ No newline at end of file diff --git a/fleet_vehicle_inspection_management/wizards/__init__.py b/fleet_vehicle_inspection_management/wizards/__init__.py new file mode 100644 index 000000000..24850605b --- /dev/null +++ b/fleet_vehicle_inspection_management/wizards/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +# Version 3 (AGPL v3) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +""" import wizard """ +from . import fleet_service_inspection diff --git a/fleet_vehicle_inspection_management/wizards/fleet_service_inspection.py b/fleet_vehicle_inspection_management/wizards/fleet_service_inspection.py new file mode 100644 index 000000000..274c51e60 --- /dev/null +++ b/fleet_vehicle_inspection_management/wizards/fleet_service_inspection.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# 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 . +# +############################################################################# +""" create service from inspection requests""" +from odoo import api, fields, models + + +class FleetServiceInspection(models.TransientModel): + """ create vehicle service""" + _name = 'fleet.service.inspection' + + service_subtype_ids = fields.Many2many('fleet.service.type', + string='Sub service Type', + help='Related filed for the ' + 'sub service type') + inspection_reference = fields.Integer(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([('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([('kilometers', 'km'), + ('miles', 'mi')], 'Odometer Unit', + default='kilometers', required=True) + sub_service_reference = fields.Integer(string='Sub Services', + help='Vehicle sub service ') + log_sub_service = fields.Integer(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', + String='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""" + service_id = self.env['fleet.vehicle.log.services'].search([ + ('inspection_reference', '=', self.id)]) + if not service_id: + inspection_id = self.env['inspection.request'].browse( + self.inspection_reference) + self.env['fleet.vehicle.log.services'].create({ + 'inspection_reference': self.id, + 'description': inspection_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': rec.id, + 'service_category': rec.category, + }) for rec in self.service_subtype_ids] + })[0] + else: + for rec in self.service_subtype_ids: + sub_service_id = self.env['fleet.service.inspection'].search([ + ('sub_service_reference', '=', rec.id)]) + if not sub_service_id: + service_id.write({ + 'sub_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'sub_service_reference': rec.id, + 'service_category': rec.category, + })], + }) + service_log_id = self.env['vehicle.service.log'].search([ + ('service_reference', '=', self.id)]) + if not service_log_id: + inspection_id = self.env['inspection.request'].browse( + self.inspection_reference) + self.env['vehicle.service.log'].create({ + 'service_reference': 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': inspection_id.name, + 'inspection_result': inspection_id.inspection_result, + 'notes': inspection_id.internal_note, + 'additional_service_ids': [(0, 0, { + 'service_type_id': rec.id, + 'vehicle_id': self.vehicle_id.id, + 'log_sub_service': 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 inspection_id.inspection_image_ids] + }) + else: + for rec in self.service_subtype_ids: + sub_service_id = self.env['fleet.service.inspection'].search([ + ('log_sub_service', '=', rec.id)]) + if not sub_service_id: + 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/wizards/fleet_service_inspection_views.xml b/fleet_vehicle_inspection_management/wizards/fleet_service_inspection_views.xml new file mode 100644 index 000000000..8e48dac4e --- /dev/null +++ b/fleet_vehicle_inspection_management/wizards/fleet_service_inspection_views.xml @@ -0,0 +1,44 @@ + + + + + fleet.service.inspection.view.form + fleet.service.inspection + +
+ + + + + + + + + +
+
+ +
+
+ + + fleet.service.inspection + ir.actions.act_window + fleet.service.inspection + form + + new + +
+