Browse Source

Jan 01 [ADD] : Initial Commit 'vehicle_subscription'

pull/309/head
AjmalCybro 4 months ago
parent
commit
16ce67a962
  1. 46
      vehicle_subscription/README.rst
  2. 24
      vehicle_subscription/__init__.py
  3. 71
      vehicle_subscription/__manifest__.py
  4. 23
      vehicle_subscription/controllers/__init__.py
  5. 440
      vehicle_subscription/controllers/vehicle_subscription.py
  6. 63
      vehicle_subscription/controllers/website_portal.py
  7. 16
      vehicle_subscription/data/ir_cron_data.xml
  8. 79
      vehicle_subscription/data/mail_data.xml
  9. 13
      vehicle_subscription/data/product_template_data.xml
  10. 12
      vehicle_subscription/data/website_menu_data.xml
  11. 6
      vehicle_subscription/doc/RELEASE_NOTES.md
  12. 29
      vehicle_subscription/models/__init__.py
  13. 32
      vehicle_subscription/models/account_move.py
  14. 265
      vehicle_subscription/models/cancellation_request.py
  15. 385
      vehicle_subscription/models/fleet_subscription.py
  16. 69
      vehicle_subscription/models/fleet_vehicle.py
  17. 34
      vehicle_subscription/models/fleet_vehicle_model.py
  18. 48
      vehicle_subscription/models/insurance_type.py
  19. 95
      vehicle_subscription/models/subscription_request.py
  20. 59
      vehicle_subscription/models/vehicle_insurance.py
  21. 8
      vehicle_subscription/security/ir.model.access.csv
  22. 17
      vehicle_subscription/security/vehicle_subscription_groups.xml
  23. BIN
      vehicle_subscription/static/description/assets/icons/capture (1).png
  24. BIN
      vehicle_subscription/static/description/assets/icons/check.png
  25. BIN
      vehicle_subscription/static/description/assets/icons/chevron.png
  26. BIN
      vehicle_subscription/static/description/assets/icons/cogs.png
  27. BIN
      vehicle_subscription/static/description/assets/icons/consultation.png
  28. BIN
      vehicle_subscription/static/description/assets/icons/ecom-black.png
  29. BIN
      vehicle_subscription/static/description/assets/icons/education-black.png
  30. BIN
      vehicle_subscription/static/description/assets/icons/hotel-black.png
  31. BIN
      vehicle_subscription/static/description/assets/icons/img.png
  32. BIN
      vehicle_subscription/static/description/assets/icons/license.png
  33. BIN
      vehicle_subscription/static/description/assets/icons/lifebuoy.png
  34. BIN
      vehicle_subscription/static/description/assets/icons/manufacturing-black.png
  35. BIN
      vehicle_subscription/static/description/assets/icons/photo-capture.png
  36. BIN
      vehicle_subscription/static/description/assets/icons/pos-black.png
  37. BIN
      vehicle_subscription/static/description/assets/icons/puzzle.png
  38. BIN
      vehicle_subscription/static/description/assets/icons/restaurant-black.png
  39. BIN
      vehicle_subscription/static/description/assets/icons/service-black.png
  40. BIN
      vehicle_subscription/static/description/assets/icons/trading-black.png
  41. BIN
      vehicle_subscription/static/description/assets/icons/training.png
  42. BIN
      vehicle_subscription/static/description/assets/icons/update.png
  43. BIN
      vehicle_subscription/static/description/assets/icons/user.png
  44. BIN
      vehicle_subscription/static/description/assets/icons/wrench.png
  45. BIN
      vehicle_subscription/static/description/assets/misc/Cybrosys R.png
  46. BIN
      vehicle_subscription/static/description/assets/misc/categories.png
  47. BIN
      vehicle_subscription/static/description/assets/misc/check-box.png
  48. BIN
      vehicle_subscription/static/description/assets/misc/compass.png
  49. BIN
      vehicle_subscription/static/description/assets/misc/corporate.png
  50. BIN
      vehicle_subscription/static/description/assets/misc/customer-support.png
  51. BIN
      vehicle_subscription/static/description/assets/misc/cybrosys-logo.png
  52. 33
      vehicle_subscription/static/description/assets/misc/email.svg
  53. BIN
      vehicle_subscription/static/description/assets/misc/features.png
  54. BIN
      vehicle_subscription/static/description/assets/misc/logo.png
  55. 3
      vehicle_subscription/static/description/assets/misc/phone.svg
  56. BIN
      vehicle_subscription/static/description/assets/misc/pictures.png
  57. BIN
      vehicle_subscription/static/description/assets/misc/pie-chart.png
  58. BIN
      vehicle_subscription/static/description/assets/misc/right-arrow.png
  59. 9
      vehicle_subscription/static/description/assets/misc/star (1) 2.svg
  60. BIN
      vehicle_subscription/static/description/assets/misc/star.png
  61. 9
      vehicle_subscription/static/description/assets/misc/support (1) 1.svg
  62. 6
      vehicle_subscription/static/description/assets/misc/support-email.svg
  63. BIN
      vehicle_subscription/static/description/assets/misc/support.png
  64. 17
      vehicle_subscription/static/description/assets/misc/tick-mark.svg
  65. 9
      vehicle_subscription/static/description/assets/misc/whatsapp 1.svg
  66. BIN
      vehicle_subscription/static/description/assets/misc/whatsapp.png
  67. 33
      vehicle_subscription/static/description/assets/misc/whatsapp.svg
  68. BIN
      vehicle_subscription/static/description/assets/modules/1.jpg
  69. BIN
      vehicle_subscription/static/description/assets/modules/2.jpg
  70. BIN
      vehicle_subscription/static/description/assets/modules/3.png
  71. BIN
      vehicle_subscription/static/description/assets/modules/4.jpg
  72. BIN
      vehicle_subscription/static/description/assets/modules/5.jpg
  73. BIN
      vehicle_subscription/static/description/assets/modules/6.jpg
  74. BIN
      vehicle_subscription/static/description/assets/screenshots/0.png
  75. BIN
      vehicle_subscription/static/description/assets/screenshots/1.png
  76. BIN
      vehicle_subscription/static/description/assets/screenshots/10.png
  77. BIN
      vehicle_subscription/static/description/assets/screenshots/11.png
  78. BIN
      vehicle_subscription/static/description/assets/screenshots/12.png
  79. BIN
      vehicle_subscription/static/description/assets/screenshots/13.png
  80. BIN
      vehicle_subscription/static/description/assets/screenshots/14.png
  81. BIN
      vehicle_subscription/static/description/assets/screenshots/15.png
  82. BIN
      vehicle_subscription/static/description/assets/screenshots/16.png
  83. BIN
      vehicle_subscription/static/description/assets/screenshots/17.png
  84. BIN
      vehicle_subscription/static/description/assets/screenshots/18.png
  85. BIN
      vehicle_subscription/static/description/assets/screenshots/19.png
  86. BIN
      vehicle_subscription/static/description/assets/screenshots/2.png
  87. BIN
      vehicle_subscription/static/description/assets/screenshots/3.png
  88. BIN
      vehicle_subscription/static/description/assets/screenshots/4.png
  89. BIN
      vehicle_subscription/static/description/assets/screenshots/5.png
  90. BIN
      vehicle_subscription/static/description/assets/screenshots/6.png
  91. BIN
      vehicle_subscription/static/description/assets/screenshots/7.png
  92. BIN
      vehicle_subscription/static/description/assets/screenshots/8.png
  93. BIN
      vehicle_subscription/static/description/assets/screenshots/9.png
  94. BIN
      vehicle_subscription/static/description/assets/screenshots/hero.gif
  95. BIN
      vehicle_subscription/static/description/banner.jpg
  96. BIN
      vehicle_subscription/static/description/icon.png
  97. 1063
      vehicle_subscription/static/description/index.html
  98. 31
      vehicle_subscription/static/src/js/change_subscription_form.js
  99. 19
      vehicle_subscription/static/src/js/change_subscription_request.js
  100. 31
      vehicle_subscription/static/src/js/subscription_cancellation.js

46
vehicle_subscription/README.rst

@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/AGPL-3.0-standalone.html
:alt: License: AGPL-3
Vehicle Subscription
====================
This module helps you to Subscribe,Cancel and Change subscription through website as well as backend.
Configuration
=============
* No additional configurations needed
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developers: (v17) Jumana Jabin MP, Contact: odoo@cybrosys.com
License
-------
GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3)
(https://www.gnu.org/licenses/agpl-3.0-standalone.html)
Contacts
--------
* Mail Contact : odoo@cybrosys.com
* Website : https://cybrosys.com
Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies.
For support and more information, please visit `Our Website <https://cybrosys.com/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__

24
vehicle_subscription/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP(<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import controllers
from . import models
from . import wizard

71
vehicle_subscription/__manifest__.py

@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author:Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': 'Vehicle Subscription',
'version': "17.0.1.0.0",
'category': 'Fleet',
'summary': """Subscribe,Cancel and Switch subscription""",
'description': """This module helps you to Subscribe,Cancel and Change
subscription through website as well as backend.""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['mail', 'contacts', 'fleet', 'account', 'sale', 'website',
'portal', ],
'data': [
'security/vehicle_subscription_groups.xml',
'security/ir.model.access.csv',
'data/ir_cron_data.xml',
'data/product_template_data.xml',
'data/website_menu_data.xml',
'data/mail_data.xml',
'views/website_portal_subscription_template.xml',
'views/fleet_vehicle_model_views.xml',
'views/fleet_subscription_views.xml',
'views/vehicle_insurance_views.xml',
'views/subscription_request_views.xml',
'views/insurance_type_views.xml',
'views/online_subscription_template.xml',
'views/online_vehicle_template.xml',
'views/account_move_views.xml',
'views/subscription_form_success_template.xml',
'views/online_vehicle_cancellation_template.xml',
'views/cancellation_request_views.xml',
'views/change_vehicle_subscription_template.xml',
'wizard/change_subscription_views.xml',
],
'assets': {
'web.assets_frontend': [
'vehicle_subscription/static/src/js/vehicle_subscription_success.js',
'vehicle_subscription/static/src/js/website_subscription.js',
'vehicle_subscription/static/src/js/vehicle_booking.js',
'vehicle_subscription/static/src/js/change_subscription_form.js',
'vehicle_subscription/static/src/js/change_subscription_request.js',
],
},
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

23
vehicle_subscription/controllers/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import vehicle_subscription
from . import website_portal

440
vehicle_subscription/controllers/vehicle_subscription.py

@ -0,0 +1,440 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP(<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from datetime import datetime, timedelta
from odoo import http
from odoo.http import request
class OnlineSubscription(http.Controller):
"""Online Vehicle subscription through website"""
@http.route(['/online/subscription/city'], type='json', auth="public",
website=True)
def get_city(self, **kwargs):
"""Calling this function using ajax rpc in order to get city
based on state """
states = request.env['res.country.state'].sudo().search_read([],
['name'])
return states
@http.route('/online/subscription', auth='public', website=True)
def subscription_form(self):
"""This function will return vehicle with which state is not null"""
vehicle_id = request.env['fleet.vehicle'].sudo().search(
[('states_id', '!=', False)])
insurance_type = request.env['insurance.type'].sudo().search([])
vals = {
'states': vehicle_id.states_id,
'all_states': request.env['res.country.state'].sudo().search_read(
[], ['name']),
'cities': [rec.location for rec in vehicle_id],
'insurance_type': insurance_type,
}
return http.request.render('vehicle_subscription.subscription_form',
vals)
@http.route('/online/subscription/next', auth='public', website=True)
def vehicle_form(self, **kw):
"""Redirect to corresponding templates according to the
data provided by user in form page """
if kw.get('start_date'):
start_date = kw.get('start_date')
end_date = kw.get('end_date')
insurance = kw.get('insurance_type')
start = datetime.strptime(start_date, '%Y-%m-%d').date()
end = datetime.strptime(end_date, '%Y-%m-%d').date()
insurance_amount = request.env['vehicle.insurance'].sudo().browse(
int(insurance)).insurance_amount
# print("insurance_amount",insurance_amount)
insurance_type = request.env['vehicle.insurance'].sudo().search(
[('insurance_type_id.id', '=', insurance),
('start_date', '<=', start), ('end_date', '>=', end)])
vehicle_ids = insurance_type.vehicle_id
subscribed_vehicle_id = (request.env['fleet.subscription'].sudo().
search(
[('state', '=', 'subscribed')]).vehicle_id)
vehicle = request.env['fleet.vehicle'].sudo().search(
[('id', 'in', vehicle_ids.ids)])
vehicle_id = vehicle.filtered(
lambda v: v.id not in subscribed_vehicle_id.ids)
if vehicle_id:
for rec in vehicle_id:
rec.write({
'insurance': insurance,
'start': start,
'end': end,
})
data = {
'vehicles': vehicle_id,
'amount': insurance_amount,
'customers': request.env.user.partner_id.name,
}
return http.request.render('vehicle_subscription.vehicle_form',
data)
else:
return http.request.render(
'vehicle_subscription.subscription_vehicle_missing')
else:
return http.request.render('vehicle_subscription.vehicle_form')
@http.route(['/online/subscription/book'], type='json', auth="public",
website=True)
def get_vehicle(self, **kwargs):
"""Ajax RPC handler for booking vehicle subscription and
creating corresponding invoices in the backend."""
extra_km = kwargs.get('extra_km')
product_template_id = (request.env.ref(
'vehicle_subscription.product_template_vehicle_subscription_form').
id)
product_id = request.env['product.product'].sudo().search(
[('product_tmpl_id', '=', product_template_id)])
vehicle = int(kwargs.get('vehicle'))
customer = kwargs.get('customer')
checked = int(kwargs.get('checked'))
invoice_type = int(kwargs.get('invoice'))
vehicle_id = request.env['fleet.vehicle'].sudo().browse(int(vehicle))
customer_id = request.env['res.partner'].sudo().search(
[('name', '=', customer)])
if extra_km == '':
km = 0
else:
km = extra_km
# print(vehicle_id.insurance, "bbbbbbbbbb")
# insurance_amount = vehicle_id.insurance.insurance_amount
# insurance_amount = request.env['vehicle.insurance'].sudo().browse(
# int(vehicle_id.insurance)).insurance_amount
# price = vehicle_id.duration * vehicle_id.subscription_price
# print("aaaaaaaaaaaaaaaa",insurance_amount + price)
subscribe = request.env['fleet.subscription'].sudo().create({
'vehicle_id': vehicle_id.id,
'customer_id': customer_id.id,
'insurance_type_id': vehicle_id.insurance,
'start_date': vehicle_id.start,
'end_date': vehicle_id.end,
'extra_km': km,
'fuel': 'without_fuel' if checked == False else 'with_fuel',
})
subscribe.action_invoice()
# subscribe.sale_id.order_line.price_unit = price
subscribe.sale_id.action_confirm()
if invoice_type:
subscribe.sale_id._create_invoices().action_post()
subscribe.invoice_ids.is_subscription = True
subscribe.sale_id.invoice_ids.is_subscription = True
else:
subscribe.sale_id.invoice_status = 'invoiced'
total_price = subscribe.sale_id.order_line.price_unit
duration = vehicle_id.duration
per_day = total_price / duration
start_date = vehicle_id.start
end_date = vehicle_id.end
next_invoice_day = start_date
while next_invoice_day <= end_date:
next_invoice_day = next_invoice_day + timedelta(days=30)
if next_invoice_day <= end_date:
durations = (next_invoice_day - start_date).days
generate_invoice = request.env[
'account.move'].sudo().create({
'move_type': 'out_invoice',
'partner_id': customer_id.id,
'invoice_date': next_invoice_day,
'invoice_origin': subscribe.sale_id.name,
'invoice_line_ids': [(0, 0, {
'product_id': product_id.id,
'name': vehicle_id.name,
'price_unit': per_day * durations,
})]
})
generate_invoice.is_subscription = True
generate_invoice.action_post()
subscribe.sale_id.invoice_ids = [(4, generate_invoice.id)]
subscribe.invoice_ids = [(4, generate_invoice.id)]
else:
next_invoice_day = end_date
durations = (next_invoice_day - start_date).days
generate_invoice = request.env[
'account.move'].sudo().create({
'move_type': 'out_invoice',
'partner_id': customer_id.id,
'invoice_date': next_invoice_day,
'invoice_line_ids': [(0, 0, {
'product_id': product_id.id,
'name': vehicle_id.name,
'price_unit': per_day * durations,
})]
})
generate_invoice.is_subscription = True
generate_invoice.action_post()
subscribe.sale_id.invoice_ids = [(4, generate_invoice.id)]
subscribe.invoice_ids = [(4, generate_invoice.id)]
break
start_date = start_date + timedelta(days=30)
values = {
'subscription_id': subscribe.id
}
return values
@http.route(['/next/vehicle', '/next/vehicle/<int:subscription_id>'],
auth='public', website=True, type='http')
def subscription_create(self):
"""Return template for successful subscription"""
current_vehicle = request.env['fleet.subscription'].sudo().search([
('customer_id', '=', request.env.user.partner_id.id),
('state', '=', 'subscribed'),
], order='write_date desc', limit=1)
context = {
'vehicle_name': current_vehicle.vehicle_id.name,
'customer_name': request.env.user.partner_id.name,
}
return request.render('vehicle_subscription.subscription_form_success',
context)
@http.route(['/online/subscription/with/fuel'], type='json', auth="public",
website=True)
def get_with_fuel(self, **kwargs):
"""Calculate price for vehicle according to fuel type """
vehicle = int(kwargs.get('vehicle'))
km = kwargs.get('extra_km')
vehicle = request.env['fleet.vehicle'].sudo().browse(vehicle)
vehicle.write({
'extra_km': km,
})
insurance_amount = vehicle.insurance
amount = request.env['vehicle.insurance'].sudo() \
.browse(int(insurance_amount)).insurance_amount
if float(km) > vehicle.free_km:
new_price = (((vehicle.extra_km / vehicle.mileage) *
vehicle.fuel_rate) +
(vehicle.duration * vehicle.subscription_price) +
amount)
else:
if float(km) <= vehicle.free_km:
new_price = ((vehicle.duration * vehicle.subscription_price) +
amount)
return str(new_price)
@http.route(['/online/subscription/without/fuel'], type='json',
auth="public",
website=True)
def get_without_fuel(self, **kwargs):
"""Calculate price for vehicle according to fuel type """
vehicle = int(kwargs.get('vehicle'))
km = kwargs.get('extra_km')
vehicle = request.env['fleet.vehicle'].sudo().browse(vehicle)
insurance_amount = vehicle.insurance
amount = request.env['vehicle.insurance'].sudo() \
.browse(int(insurance_amount)).insurance_amount
vehicle.write({
'extra_km': km,
})
if float(km) > vehicle.free_km:
new_price = (((vehicle.duration * vehicle.subscription_price) +
amount) + (vehicle.charge_km * vehicle.extra_km))
else:
new_price = (
vehicle.duration * vehicle.subscription_price) + amount
return str(new_price)
@http.route('/online/subscription/cancel', auth='public', website=True)
def cancellation_form(self):
"""Cancel subscription form through website"""
customer_id = request.env['res.partner'].sudo().search(
[('name', '=', request.env.user.partner_id.name)])
vehicle_id = request.env['fleet.subscription'].sudo().search(
[('customer_id', '=', customer_id.id),
('state', '=', 'subscribed')])
vals = {
'customers': customer_id.name,
'vehicles': vehicle_id,
}
return http.request.render(
'vehicle_subscription.subscription_cancellation_form', vals)
@http.route('/online/choose/vehicle', type='json', auth="public",
website=True)
def choose_vehicle(self, **kwargs):
"""Only display vehicle of selected customer in website"""
customer = kwargs.get('customer_id')
customer_id = request.env['res.partner'].sudo().search(
[('name', '=', customer)])
vehicle_id = request.env['fleet.subscription'].sudo().search(
[('state', '=', 'subscribed'),
('customer_id', '=', customer_id.id)]).mapped('vehicle_id')
if vehicle_id:
vehicle = [(rec.id, rec.name) for rec in vehicle_id]
return [*set(vehicle)]
@http.route('/online/cancellation/click', auth='public', type='http',
website=True)
def cancellation_click_form(self, **kwargs):
"""Proceed with cancellation button click"""
customer = kwargs.get('customer')
vehicle = int(kwargs.get('vehicle'))
reason = kwargs.get('reason')
customer_id = request.env['res.partner'].sudo().search(
[('name', '=', customer)])
subscription = request.env['fleet.subscription'].sudo().browse(vehicle)
vehicle_id = subscription.vehicle_id
existing_request = request.env['cancellation.request'].sudo().search([
('customer_id', '=', customer_id.id),
('vehicle_id', '=', vehicle_id.id),
('state', '!=', 'cancel')
], limit=1)
if existing_request:
values = {
'customer': customer,
'vehicle': vehicle_id.name,
'existing_request': existing_request,
}
return request.render(
'vehicle_subscription.existing_cancellation_popup', values)
cancel_request = request.env['cancellation.request'].sudo().create({
'customer_id': customer_id.id,
'vehicle_id': vehicle_id.id,
'reason': reason,
})
values = {
'customer': customer,
'vehicle': vehicle_id.name,
}
cancel_request.state = 'to_approve'
return request.render('vehicle_subscription.booking_cancellation',
values)
@http.route('/online/subscription/change', auth='public', website=True)
def subscription_change_form(self):
"""Rendered response for the 'vehicle_subscription.
subscription_change_form' template,
containing the available vehicles and the current customer's name."""
customer = request.env.user.partner_id.name
customer_id = request.env['res.partner'].sudo().search(
[('name', '=', customer)])
invoice = request.env['account.move'].sudo().search([
('invoice_line_ids.product_id', 'like', 'Vehicle Subscription'),
('partner_id', '=', customer_id.id)
])
vehicle_names = [line.name for line in invoice.invoice_line_ids if
line.product_id.name == 'Vehicle Subscription']
vehicles = request.env['fleet.vehicle'].sudo().search(
[('name', 'in', vehicle_names)])
filtered_vehicles = vehicles
for vehicle in vehicles:
existing_request = request.env['subscription.request'].sudo().search([
('customer_id', '=', customer_id.id),
('current_vehicle_id', '=', vehicle.id),
('state', '!=', 'cancel'),('is_subscription' ,'!=',True)
])
already_request = request.env['subscription.request'].sudo().search([
('customer_id', '=', customer_id.id),
('current_vehicle_id', '=', vehicle.id),
('state', '!=', 'cancel'),('is_subscription' ,'=',True)
])
already_vehicle = already_request.current_vehicle_id
if existing_request:
values = {
'customer': customer,
'current_vehicle': existing_request.current_vehicle_id.name,
'existing_request': existing_request,
}
return request.render(
'vehicle_subscription.existing_subscription_popup', values)
else:
vals = {
'vehicles': filtered_vehicles.filtered(lambda v: v.id != already_vehicle.id),
'customers': customer_id.name,
}
return http.request.render(
'vehicle_subscription.subscription_change_form', vals)
@http.route('/online/subscription/change/vehicle', auth='public',
type='http', website=True)
def change_click_form(self, **kwargs):
""" Rendered response based on the conditions:
- If the 'customer' parameter exists, render the
'vehicle_subscription.subscription_change_button' template
with the provided data.
- If the 'customer' parameter does not exist, render the
'vehicle_subscription.subscription_change_boolean_false'
template."""
if kwargs.get('customer'):
customer = kwargs.get('customer')
vehicle = int(kwargs.get('vehicle'))
reason = kwargs.get('reason')
checkbox = kwargs.get('checkbox_model')
customer_id = request.env['res.partner'].sudo(). \
search([('name', '=', customer)])
vehicle_id = request.env['fleet.vehicle'].sudo().browse(vehicle)
new_vehicle_id = request.env['fleet.vehicle'].sudo() \
.search([('model_id', '!=', vehicle_id.model_id.id)])
if checkbox == 'on':
values = {
'customer_name': customer_id.name,
'vehicle_name': vehicle_id.name,
'vehicles': [rec for rec in new_vehicle_id],
'reason': reason,
}
return request.render(
'vehicle_subscription.subscription_change_button', values)
else:
return request.render(
'vehicle_subscription.subscription_change_boolean_false')
else:
return request.render(
'vehicle_subscription.subscription_change_button')
@http.route('/online/subscription/change/button', auth='public',
type='http', website=True)
def click_form(self, **kwargs):
"""Rendered response for the
'vehicle_subscription.change_subscription' template. """
customer = kwargs.get('customer')
reason = kwargs.get('reason')
current_vehicle = kwargs.get('vehicle')
vehicle_id = int(kwargs.get('new_vehicle'))
current_vehicle_id = request.env['fleet.vehicle'].sudo() \
.search([('name', '=', current_vehicle)])
customer_id = request.env['res.partner'].sudo() \
.search([('name', '=', customer)])
vehicle = request.env['fleet.vehicle'].sudo().browse(vehicle_id)
change_subscription = request.env['subscription.request'] \
.sudo().create({
'current_vehicle_id': current_vehicle_id.id,
'new_vehicle_id': vehicle.id,
'reason_to_change': reason,
'customer_id': customer_id.id,
'is_subscription': True,
})
change_subscription.is_subscription = True
change_subscription.state = 'to_approve'
return request.render('vehicle_subscription.change_subscription')
@http.route('/online/proceed/cancellation', auth='public', type='http',
website=True)
def proceed_cancellation(self):
"""Proceed with cancellation in change subscription """
return request.redirect('/online/subscription/cancel')
@http.route(['/web/signup/user'], type='http', auth="user",
website=True)
def redirect_login(self):
"""Used to redirect on clicking signup page"""
return request.redirect('/online/subscription')

63
vehicle_subscription/controllers/website_portal.py

@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import http
from odoo.http import request
from odoo.addons.portal.controllers.portal import CustomerPortal, \
pager as portal_pager
class PortalAccount(CustomerPortal):
"""PortalAccount for subscription"""
@http.route(['/my/subscription/invoice'], type='http', auth="user",
website=True)
def portal_my_subscription_order(self, page=1, date_begin=None,
date_end=None, sortby=None, filterby=None):
"""Rendered response for the '
vehicle_subscription.portal_my_invoices_subscription' template,
containing the subscription invoices."""
partner = request.env.user.partner_id
values = self._prepare_my_invoices_values(page, date_begin, date_end,
sortby, filterby)
pager = portal_pager(**values['pager'])
domain = [
('invoice_line_ids.product_id', 'like', 'Vehicle Subscription'),
('partner_id', '=', partner.id)
]
values.update({
'invoices': request.env['account.move'].sudo().search(domain),
'pager': pager,
})
return request.render(
"vehicle_subscription.portal_my_invoices_subscription", values)
def _prepare_home_portal_values(self, counters):
"""Prepare the values for the home portal page."""
values = super()._prepare_home_portal_values(counters)
partner = request.env.user.partner_id
if 'subscription_count' in counters:
values['subscription_count'] = request.env['account.move'].sudo() \
.search_count(
[(
'invoice_line_ids.product_id', 'like', 'Vehicle Subscription'),
('partner_id', '=', partner.id)])
return values

16
vehicle_subscription/data/ir_cron_data.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!--Cron action for checking expiration-->
<record id="ir_cron_expiry_date_action" model="ir.cron">
<field name="name">Subscription Expired</field>
<field name="model_id" ref="model_fleet_subscription"/>
<field name="state">code</field>
<field name="code">model._onchange_end_date()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="active" eval="True"/>
</record>
</data>
</odoo>

79
vehicle_subscription/data/mail_data.xml

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!--Cron action for checking expiration-->
<record id="ir_cron_expiry_date_action" model="ir.cron">
<field name="name">Subscription Expired</field>
<field name="model_id" ref="model_fleet_subscription"/>
<field name="state">code</field>
<field name="code">model._onchange_end_date()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="active" eval="True"/>
</record>
<!--Subscription cancellation mail template-->
<record id="cancellation_request_mail" model="mail.template">
<field name="name">Vehicle Cancellation</field>
<field name="model_id"
ref="vehicle_subscription.model_cancellation_request"/>
<field name="subject">Subscription Cancellation</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>
Dear
<br/>
Sorry....you need to pay amount till date inorder to
cancel
subscription.Your invoice is attached
below
<br/>
</p>
Regards,
<br/>
<t t-out="user.name"/>
</div>
</field>
</record>
<!-- Mail template for refund in subscription cancellation -->
<record id="cancellation_request_refund_mail" model="mail.template">
<field name="name">Vehicle Cancellation</field>
<field name="model_id"
ref="vehicle_subscription.model_cancellation_request"/>
<field name="subject">Subscription Cancellation</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>
Dear
<br/>
The amount should be refunded immediately.
<br/>
</p>
Regards,
<br/>
<t t-out="user.name"/>
</div>
</field>
</record>
<!-- Mail template for approval of subscription cancellation -->
<record id="cancellation_approved" model="mail.template">
<field name="name">Vehicle Cancellation</field>
<field name="model_id"
ref="vehicle_subscription.model_cancellation_request"/>
<field name="subject">Subscription Cancellation</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>
Dear
<br/>
Your request for subscription cancellation is approved
<br/>
</p>
Regards,
<br/>
<t t-out="user.name"/>
</div>
</field>
</record>
</data>
</odoo>

13
vehicle_subscription/data/product_template_data.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--Created vehicle subscription as a service product-->
<record id="product_template_vehicle_subscription_form"
model="product.template">
<field name="name">Vehicle Subscription</field>
<field name="detailed_type">service</field>
<field name="invoice_policy">order</field>
<field name="sequence" type="int">55</field>
</record>
</data>
</odoo>

12
vehicle_subscription/data/website_menu_data.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Subscription form in website -->
<data noupdate="1">
<record id="menu_subscription_form" model="website.menu">
<field name="name">Subscription Form</field>
<field name="url">/online/subscription</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">55</field>
</record>
</data>
</odoo>

6
vehicle_subscription/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <vehicle_subscription>
#### 04.01.2025
#### Version 17.0.1.0.0
#### ADD
- Initial Commit Vehicle Subscription

29
vehicle_subscription/models/__init__.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import account_move
from . import cancellation_request
from . import fleet_subscription
from . import fleet_vehicle
from . import fleet_vehicle_model
from . import insurance_type
from . import subscription_request
from . import vehicle_insurance

32
vehicle_subscription/models/account_move.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author:Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class AccountMove(models.Model):
"""Inherited account move to add a field """
_inherit = 'account.move'
is_subscription = fields.Boolean(string="Subscribe",
help="This field will be set true for "
"invoice corresponding to vehicle "
"subscription")

265
vehicle_subscription/models/cancellation_request.py

@ -0,0 +1,265 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
import base64
from datetime import date
from odoo import fields, models
class CancellationRequest(models.Model):
"""Created new model to add new fields and function"""
_name = "cancellation.request"
_description = "Cancellation Request"
_inherit = "mail.thread"
_rec_name = 'vehicle_id'
vehicle_id = fields.Many2one('fleet.vehicle',
string="Vehicle", help="Choose vehicle "
"inorder to cancel "
"subscription",
required=True)
date = fields.Date(string="Cancellation Date", default=fields.Date.today(),
help="Date for cancellation of vehicle")
customer_id = fields.Many2one('res.partner', string="Customer",
help="Choose Customer for the cancellation "
"of vehicle", required=True)
reason = fields.Char(string="Cancellation Reason", help="Describe the "
"reason for "
"cancellation")
state = fields.Selection(selection=[('draft', 'Draft'),
('to_approve', 'To Approve'),
('approved', 'Approved')],
string='State', default='draft',
help="States of cancellation subscription")
def action_request(self):
"""Change state to to_approve"""
self.write({'state': 'to_approve'})
def action_approve(self):
"""Handle cancellation approval by manager.
This method handles the approval process for a cancellation
request in a vehicle subscription system.
It updates the cancellation state, generates invoices or refunds
based on the payment status, and sends notifications to the customer."""
self.write({'state': 'approved'})
subscription = self.env['fleet.subscription'].search(
[('vehicle_id', '=', self.vehicle_id.id),
('customer_id', '=', self.customer_id.id)])
invoice = subscription.sale_id.invoice_ids
multy_invoice = subscription.invoice_ids
product_template_id = self.env.ref(
'vehicle_subscription.product_template_vehicle_subscription_form').id
product_id = self.env['product.product'].search(
[('product_tmpl_id', '=', product_template_id)], limit=1)
if subscription.duration != 0:
per_day_price = subscription.sale_id.amount_untaxed / subscription.duration
else:
per_day_price = 0
if isinstance(self.date, date) and isinstance(subscription.start_date,
date):
invoice_duration = (self.date - subscription.start_date).days
else:
invoice_duration = 0
email_template = self.env.ref(
'vehicle_subscription.cancellation_request_mail')
template_approved = self.env.ref(
'vehicle_subscription.cancellation_approved')
refund_approved = self.env.ref(
'vehicle_subscription.cancellation_request_refund_mail')
uptodate_price = round(per_day_price * invoice_duration, 2)
paid_amount = self.env['account.move'].search(
[('id', 'in', subscription.invoice_ids.ids),
('payment_state', 'in', ['paid', 'partial'])]).mapped(
'amount_untaxed_signed')
if paid_amount:
if sum(paid_amount) == uptodate_price:
subscription.state = 'cancel'
email_values = {
'email_to': self.customer_id.email,
'email_from': self.env.user.email,
}
template_approved.send_mail(self.id, email_values=email_values,
force_send=True)
elif sum(paid_amount) < uptodate_price:
if len(invoice) == 1 or len(multy_invoice) == 1:
invoice.button_cancel()
generate_invoice = self.env['account.move'].sudo().create({
'move_type': 'out_invoice',
'partner_id': self.customer_id.id,
'invoice_date': self.date,
'invoice_line_ids': fields.Command.create([{
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': (per_day_price * invoice_duration) - sum(
paid_amount),
}])
})
generate_invoice.action_post()
data_record = base64.b64encode(
self.env['ir.actions.report'].sudo()._render_qweb_pdf(
"account.account_invoices", generate_invoice.ids)[
0])
ir_values = {
'name': 'Invoice',
'type': 'binary',
'datas': data_record,
'store_fname': 'invoice.pdf',
'mimetype': 'application/pdf',
'res_model': 'account.move',
'res_id': generate_invoice.id,
}
invoice_report_attachment_id = self.env[
'ir.attachment'].sudo().create(ir_values)
email_values = {
'email_to': self.customer_id.email,
'email_from': self.env.user.email,
'attachment_ids': [invoice_report_attachment_id.id]
}
email_template.send_mail(self.id,
email_values=email_values,
force_send=True)
email_template.attachment_ids = []
subscription.invoice_ids = fields.Command.link(
generate_invoice.id)
subscription.sale_id.write({
'invoice_ids': fields.Command.link(generate_invoice.id)
})
else:
for invoice_id in multy_invoice:
invoice = self.env['account.move'].browse(
invoice_id.id)
invoice.button_cancel()
generate_invoice = self.env['account.move'].sudo().create({
'move_type': 'out_invoice',
'partner_id': self.customer_id.id,
'invoice_date': self.date,
'invoice_line_ids': fields.Command.create([{
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': (per_day_price * invoice_duration) - sum(
paid_amount),
}])
})
generate_invoice.action_post()
data_record = base64.b64encode(
self.env['ir.actions.report'].sudo()._render_qweb_pdf(
"account.account_invoices", generate_invoice.ids)[
0])
ir_values = {
'name': 'Invoice',
'type': 'binary',
'datas': data_record,
'store_fname': 'invoice.pdf',
'mimetype': 'application/pdf',
'res_model': 'account.move',
'res_id': generate_invoice.id,
}
invoice_report_attachment_id = self.env[
'ir.attachment'].sudo().create(ir_values)
email_values = {
'email_to': self.customer_id.email,
'email_from': self.env.user.email,
'attachment_ids': [invoice_report_attachment_id.id]
}
email_template.send_mail(self.id,
email_values=email_values,
force_send=True)
email_template.attachment_ids = []
subscription.invoice_ids = fields.Command.link(
generate_invoice.id)
subscription.sale_id.write({
'invoice_ids': fields.Command.link(generate_invoice.id)
})
else:
generate_refund = self.env['account.move'].sudo().create({
'move_type': 'out_refund',
'invoice_date': fields.Date.today(),
'partner_id': self.customer_id.id,
'invoice_line_ids': fields.Command.create([{
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': (sum(paid_amount) - uptodate_price)
}])
})
generate_refund.action_post()
subscription.refund_id = generate_refund
data_record = base64.b64encode(
self.env['ir.actions.report'].sudo()._render_qweb_pdf(
"account.account_invoices", generate_refund.ids)[0])
ir_values = {
'name': 'Invoice',
'type': 'binary',
'datas': data_record,
'store_fname': 'invoice.pdf',
'mimetype': 'application/pdf',
'res_model': 'account.move',
'res_id': generate_refund.id,
}
invoice_report_attachment_id = self.env[
'ir.attachment'].sudo().create(ir_values)
email_values = {
'email_to': self.customer_id.email,
'email_from': self.env.user.email,
'attachment_ids': [invoice_report_attachment_id.id]
}
refund_approved.send_mail(self.id, email_values=email_values,
force_send=True)
refund_approved.attachment_ids = fields.Command.clear()
else:
invoice.button_cancel()
generate_invoice = self.env['account.move'].sudo().create({
'move_type': 'out_invoice',
'partner_id': self.customer_id.id,
'invoice_date': self.date,
'invoice_line_ids': [fields.Command.create({
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': per_day_price * invoice_duration,
})]
})
generate_invoice.action_post()
data_record = base64.b64encode(
self.env['ir.actions.report'].sudo()._render_qweb_pdf(
"account.account_invoices", generate_invoice.ids)[0])
ir_values = {
'name': 'Invoice',
'type': 'binary',
'datas': data_record,
'store_fname': 'invoice.pdf',
'mimetype': 'application/pdf',
'res_model': 'account.move',
'res_id': generate_invoice.id,
}
invoice_report_attachment_id = self.env[
'ir.attachment'].sudo().create(ir_values)
email_values = {
'email_to': self.customer_id.email,
'email_from': self.env.user.email,
'attachment_ids': [invoice_report_attachment_id.id]
}
email_template.send_mail(self.id, email_values=email_values,
force_send=True)
email_template.attachment_ids = []
subscription.invoice_ids = fields.Command.link(generate_invoice.id)
subscription.sale_id.write({
'invoice_ids': fields.Command.link(generate_invoice.id)
})

385
vehicle_subscription/models/fleet_subscription.py

@ -0,0 +1,385 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from datetime import datetime
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class VehicleSubscription(models.Model):
"""Created new model to add new fields and function"""
_name = "fleet.subscription"
_description = "Fleet Subscription"
_inherit = "mail.thread"
_rec_name = 'vehicle_id'
vehicle_id = fields.Many2one('fleet.vehicle', string="Vehicle",
domain="[('id', 'in',vehicle_ids)]",
help="This field help you to choose vehicle",
required=True)
vehicle_ids = fields.Many2many('fleet.vehicle', string="Vehicle",
compute='_compute_vehicle_ids',
help="Returns vehicle by satisfying "
"the domain")
model_id = fields.Many2one(related="vehicle_id.model_id", string='Model',
help="This field help you to choose model "
"of vehicle")
price = fields.Float(compute="_compute_price", string='Price',
help="Compute field which results the price of vehicle")
uptodate_price = fields.Float(compute="_compute_uptodate_price",
string='Price',
help="Compute field which results the price"
"of vehicle until the date ")
extra_price = fields.Float(string="Extra Price",
compute="_compute_extra_price",
help="Compute field which results the extra "
"price of vehicle")
start_date = fields.Date(string="Start Date", required=True,
help="Start date of subscription")
end_date = fields.Date(string="End Date", required=True,
help="End date of subscription")
cancellation_date = fields.Date(string="Cancellation Date",
default=fields.Date.today(),
help="Subscription cancellation date")
duration = fields.Integer(string="Duration", compute='_compute_duration',
help="Compute subscription duration")
cancel_duration = fields.Integer(string="Duration",
compute='_compute_cancel_duration',
help="compute cancel duration")
state = fields.Selection(
selection=[('draft', 'Draft'), ('subscribed', 'Subscribed'),
('cancel', 'Cancelled'), ('expired', 'Expired')
], string='State', default='draft',
help="States of subscription")
street = fields.Char(string="Street", help="Choose the street")
state_id = fields.Many2one("res.country.state", string='State',
ondelete='restrict',
domain="[('country_id', '=?', country_id)]",
help="Choose the state")
city = fields.Char(string="City", help="Choose the city")
country_id = fields.Many2one('res.country', string='Country',
ondelete='restrict',
help="Choose the country")
fuel = fields.Selection(selection=[('with_fuel', 'With Fuel'),
('without_fuel', 'Without Fuel')],
string="Fuel Choice", default='without_fuel',
help="Help you to choose the type of fuel")
fuel_type = fields.Selection(string="Fuel Type",
related=
"vehicle_id.model_id.default_fuel_type",
help="Fuel type will be given which is related"
" to the model")
fuel_rate = fields.Integer(String="Rate", default=300, help="Rate of fuel")
charge_km = fields.Integer(string="Charge in km", default=12,
help="Rate per kilometer")
default_km = fields.Float(string="Default KMS",
related='vehicle_id.free_km',
help="Default km is set based on free km of "
"vehicle which is given by authorised "
"person")
extra_km = fields.Float(string="Extra KMS", default_km=1,
help="As per customer he/she can choose extra km")
mileage = fields.Float(string='Mileage',
related='vehicle_id.model_id.mileage',
help="Helps to set mileage of vehicle")
sale = fields.Integer(string="sale", compute='_compute_sale',
help="Helps you to store count of sale")
invoice = fields.Integer(string="Invoice", compute='_compute_invoice',
help="Helps you to store count of invoice")
invoice_ids = fields.Many2many('account.move', string='Invoices',
help="Used to store ids of invoices")
customer_id = fields.Many2one('res.partner', string="Customer",
help="Helps you to choose customer")
sale_id = fields.Many2one('sale.order', string='sale', readonly=True,
help="Stores id of sale order")
refund_id = fields.Many2one('account.move', string='Refund', readonly=True,
help="Stores id of invoice which belongs "
"to refund")
insurance_type_id = fields.Many2one('vehicle.insurance',
domain=
"[('vehicle_id', '=',vehicle_id)]")
refund = fields.Integer(compute='_compute_refund',
help="Helps you to store count of refund")
seating_capacity = fields.Integer(string='Seating Capacity',
help="Seating capacity of vehicle can "
"be set")
invisible_sub = fields.Boolean(string="Approve Subscription",
help="As subscription request get approved "
"this field will be enabled")
def _get_vehicle_domain(self):
"""This method retrieves the vehicles that meet the following
criteria"""
insurance_ids = self.env['vehicle.insurance'].search([]).mapped(
'vehicle_id')
domain = []
for record in insurance_ids:
state = record.log_services.mapped('state')
if 'done' in state and 'running' not in state and 'new' \
not in state and 'cancelled' not in state:
if not self.search(
[('vehicle_id', '=', record.id),
('state', '!=', 'subscribe')]):
domain.append(record.id)
return domain
@api.onchange('vehicle_id')
def _onchange_vehicle_id(self):
"""Function used to fill the seating capacity"""
if self.vehicle_id:
self.seating_capacity = self.vehicle_id.model_id.seats
@api.onchange('seating_capacity')
def _onchange_seating_capacity(self):
"""As the seating capacity changes vehicles are shown """
if self.seating_capacity != self.vehicle_id.model_id.seats:
self.vehicle_id = False
@api.onchange('default_km')
def _onchange_default_km(self):
"""Charge per km is set as onchange of default_km"""
if self.default_km <= self.vehicle_id.free_km:
self.charge_km = 0
@api.depends('vehicle_id', 'seating_capacity')
def _compute_vehicle_ids(self):
"""Compute the vehicle_IDS based on the vehicle and seating
capacity."""
for rec in self:
if not rec.vehicle_ids:
domain = rec._get_vehicle_domain()
if rec.seating_capacity:
model_id = self.env['fleet.vehicle'].search(
[('state_id', '=', 'registered'),
('model_id.seats', '=', rec.seating_capacity),
('id', 'in', domain)])
else:
model_id = self.env['fleet.vehicle'].search(
[('id', 'in', domain)])
for record in model_id:
rec.vehicle_ids = [(4, record.id)]
@api.depends('start_date', 'end_date')
def _compute_duration(self):
"""Compute duration based on start and end date"""
for record in self:
if record.end_date:
if record.end_date < record.start_date:
raise ValidationError(_(
"End date should be greater than start date."))
if record.start_date and record.end_date:
start = record.start_date.strftime("%Y-%m-%d")
end = record.end_date.strftime("%Y-%m-%d")
start_datetime = datetime.strptime(start, "%Y-%m-%d")
end_datetime = datetime.strptime(end, "%Y-%m-%d")
delta = end_datetime - start_datetime
record.duration = delta.days
else:
record.duration = 0
@api.depends('start_date', 'cancellation_date')
def _compute_cancel_duration(self):
"""Compute duration based on cancellation date"""
for record in self:
if record.start_date and record.cancellation_date:
start = record.start_date.strftime("%Y-%m-%d")
end = record.cancellation_date.strftime("%Y-%m-%d")
start_datetime = datetime.strptime(start, "%Y-%m-%d")
end_datetime = datetime.strptime(end, "%Y-%m-%d")
delta = end_datetime - start_datetime
record.cancel_duration = delta.days
else:
record.cancel_duration = 0
@api.depends('extra_km', 'charge_km', 'fuel_rate', 'fuel')
def _compute_extra_price(self):
"""Compute extra charges based on criteria"""
for rec in self:
if rec.fuel == 'without_fuel':
rec.extra_price = (rec.extra_km * rec.charge_km)
elif rec.mileage == 0:
raise ValidationError(_("Mileage cannot be zero."))
else:
rec.extra_price = (
(rec.extra_km / rec.mileage) * rec.fuel_rate)
@api.depends('duration')
def _compute_price(self):
"""Function used to compute price of vehicle"""
for rec in self:
rec.price = (rec.duration * rec.vehicle_id.subscription_price) \
+ rec.insurance_type_id.insurance_amount
@api.depends('cancel_duration')
def _compute_uptodate_price(self):
"""Compute price as per the cancellation date"""
for rec in self:
rec.uptodate_price = (
(rec.sale_id.order_line.price_unit / rec.duration) * (
(rec.cancellation_date - rec.start_date).days))
def action_get_car_insurance(self):
"""Get the action to view the car
insurance associated with the subscription."""
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': 'Insurance',
'view_mode': 'form',
'res_model': 'vehicle.insurance',
'res_id': self.insurance_type_id.id,
'context': [('create', '=', False)]
}
def action_get_sale(self):
"""Get the action to view the sale
associated with the subscription."""
return {
'type': 'ir.actions.act_window',
'name': 'Sale Order',
'view_mode': 'form',
'res_model': 'sale.order',
'res_id': self.sale_id.id,
'context': [('create', '=', False)]
}
def _compute_sale(self):
"""Used to calculate the sale count"""
for record in self:
record.sale = self.env['sale.order'].search_count(
[('id', '=', self.sale_id.id)])
def action_get_refund(self):
"""Get the action to view the refund
associated with the subscription."""
return {
'type': 'ir.actions.act_window',
'name': 'Refund',
'view_mode': 'form',
'res_id': self.refund_id.id,
'res_model': 'account.move',
'context': [('create', '=', False)]
}
def _compute_refund(self):
"""Used to calculate count of refund"""
for record in self:
record.refund = self.env['account.move'].search_count(
[('id', '=', self.refund_id.id)])
def action_get_invoice(self):
"""Get the action to view the invoice
associated with the subscription."""
invoice_ids = self.invoice_ids + self.sale_id.invoice_ids
return {
'type': 'ir.actions.act_window',
'name': 'Sale Order',
'view_mode': 'tree,form',
'res_model': 'account.move',
'domain': [('id', 'in', invoice_ids.ids)],
'context': [('create', '=', False)]
}
def _compute_invoice(self):
"""Used to calculate invoice count"""
for record in self:
invoice_ids = record.invoice_ids + record.sale_id.invoice_ids
record.invoice = self.env['account.move'].search_count(
[('id', 'in', invoice_ids.ids)])
def action_invoice(self):
"""Used to generate invoice on clicking the button"""
self.write({'state': 'subscribed'})
product_template_id = self.env.ref(
'vehicle_subscription.product_template_vehicle_subscription_form').id
product_id = self.env['product.product'].search(
[('product_tmpl_id', '=', product_template_id)])
sale_order_id = self.env['sale.order'].create({
'partner_id': self.customer_id.id,
'order_line': [(0, 0, {
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': self.price + self.extra_price,
})]
})
self.sale_id = sale_order_id
def action_request(self):
"""Request for change subscription is generated """
return {
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'change.subscription',
'target': 'new',
}
def action_cancel(self):
"""Proceed with cancellation of subscription"""
product_template_id = self.env.ref(
'vehicle_subscription.product_template_vehicle_subscription_form').id
product_id = self.env['product.product'].search(
[('product_tmpl_id', '=', product_template_id)], limit=1)
invoice = self.env['account.move'].search(
[('id', 'in', self.invoice_ids.ids),
('payment_state', 'in', ['paid', 'partial'])]).mapped(
'amount_untaxed_signed')
invoiced_amount = sum(invoice)
total_price = self.uptodate_price
if invoiced_amount == total_price:
self.write({'state': 'cancel'})
self.sale_id.action_done()
elif invoiced_amount > total_price:
self.write({'state': 'cancel'})
self.refund_id = self.env['account.move'].create({
'move_type': 'out_refund',
'invoice_date': fields.Date.today(),
'partner_id': self.customer_id.id,
'invoice_line_ids': [fields.Command.create({
'product_id': product_id.id,
'name': self.vehicle_id.name,
'price_unit': self.uptodate_price + self.extra_price,
})]
})
else:
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': _('Warning'),
'message': _(
'You need to pay the amount till date in order to '
'cancel the subscription'),
'sticky': True,
}
}
@api.onchange('end_date')
def _onchange_end_date(self):
"""Check expiry for subscription"""
if self.end_date:
if self.end_date < fields.Date.today():
self.write({'state': 'expired'})
@api.constrains('start_date', 'end_date')
def _check_dates(self):
"""Ensure that the start date is not greater than the end date."""
for rec in self:
if rec.start_date > rec.end_date:
raise ValidationError(
"Start Date cannot be greater than End Date")

69
vehicle_subscription/models/fleet_vehicle.py

@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from datetime import datetime
from odoo import api, fields, models
class FleetVehicle(models.Model):
"""Inherited model to add fields and functions"""
_inherit = 'fleet.vehicle'
free_km = fields.Float(string="Free KM", required=True, default=1500,
help="Set free km for each vehicle")
subscription_price = fields.Float(string="Subscription price per day",
help='Price of vehicle per day',
required=True, default=12)
states_id = fields.Many2one("res.country.state", string='State',
help="Help you choose the state")
countries_id = fields.Many2one('res.country', string='Country',
help="help you to choose country")
insurance = fields.Char(string="Insurance",
help="Helps you to set Insurance")
start = fields.Date(string="Start Date",
help="Helps you to choose start date")
end = fields.Date(string="End Date", help="Helps you to choose end date")
duration = fields.Integer(string="Duration", compute='_compute_duration')
fuel = fields.Selection(selection=[('with_fuel', 'With Fuel'),
('without_fuel', 'Without Fuel')],
string="Fuel Choice", default='without_fuel',
help="Help you to choose the type of fuel")
fuel_rate = fields.Integer(String="Rate", default=300, help="Rate of fuel")
charge_km = fields.Integer(string="Charge in km", default=12,
help="Rate per kilometer")
extra_km = fields.Float(string="Extra KMS", default=1500,
help="As per customer he/she can choose extra km")
mileage = fields.Float(related='model_id.mileage', string='Mileage',
help="Helps to set mileage of vehicle")
@api.depends('start', 'end')
def _compute_duration(self):
"""Compute duration of days based on start and end date"""
for record in self:
if record.start and record.end:
start = record.start.strftime("%Y-%m-%d")
end = record.end.strftime("%Y-%m-%d")
start_datetime = datetime.strptime(start, "%Y-%m-%d")
end_datetime = datetime.strptime(end, "%Y-%m-%d")
delta = end_datetime - start_datetime
record.duration = delta.days
else:
record.duration = 0

34
vehicle_subscription/models/fleet_vehicle_model.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class FleetVehicleModel(models.Model):
"""Inherited fleet.vehicle.model to add fields"""
_inherit = 'fleet.vehicle.model'
mileage = fields.Float(string="Mileage", required=True,
default=12, help="Helps you to set mileage for "
"vehicle")
seats = fields.Integer(string='Seats Number', required=True,
default=4, helps="Helps you to choose seating "
"capacity")

48
vehicle_subscription/models/insurance_type.py

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class InsuranceType(models.Model):
"""New model insurance type to add fields"""
_name = "insurance.type"
_description = "Insurance type"
_inherit = "mail.thread"
name = fields.Char(string="Insurance Name", required=True,
help="This field is used to set name for insurance")
coverage_ids = fields.One2many('insurance.coverage', 'coverage_id',
string="Coverage",
help="Helps you to give details of coverage")
class InsuranceCoverageType(models.Model):
"""One2many field for insurance type"""
_name = 'insurance.coverage'
_description = "Insurance Coverage"
description = fields.Char(string="Description", help="Detail of coverage",
required=True)
coverage_price = fields.Float(string="Price", help="Rate of insurance",
required=True)
coverage_id = fields.Many2one('insurance.type',
help="Can choose insurance type")

95
vehicle_subscription/models/subscription_request.py

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models
class SubscriptionRequest(models.Model):
"""New model subscription.request"""
_name = "subscription.request"
_description = "Subscription Request"
_inherit = "mail.thread"
_rec_name = "new_vehicle_id"
customer_id = fields.Many2one('res.partner', string="Customer",
help="Choose the customer for subscription "
"request")
sale_id = fields.Many2one('sale.order', string='sale', readonly=True,
help="Helps you to store sale order")
refund_id = fields.Many2one('account.move', string='Refund', readonly=True)
current_vehicle_id = fields.Many2one('fleet.vehicle',
string="Current Vehicle",
help="Currently using vehicle of "
"customer will be set",
required=True)
new_vehicle_id = fields.Many2one('fleet.vehicle', string="New Vehicle"
, domain="[('id', 'in', vehicle_ids)]",
help="Can choose different vehicle "
"with same model", required=True)
vehicle_ids = fields.Many2many('fleet.vehicle',
compute='_compute_vehicle_ids',
help="Compute and can choose vehicle with "
"satisfying domain ")
reason_to_change = fields.Char(string="Reason", required=True,
help="Reason for changing vehicle")
state = fields.Selection(
selection=[('to_approve', 'To Approve'),
('approved', 'Approved'),
], string='State', default='to_approve',
help="States of subscription")
is_subscription = fields.Boolean(string="Subscription",
help="Online Subscriptions")
@api.depends('current_vehicle_id')
def _compute_vehicle_ids(self):
"""This method searches for vehicles with the same model and brand
as the current vehicle, excluding the current vehicle itself.
The vehicle IDs are updated accordingly, and the state
is set to 'to_approve'."""
self.vehicle_ids = False
model_id = self.env['fleet.vehicle'].search(
[('model_id', '=', self.current_vehicle_id.model_id.id),
('model_id.brand_id', '=',
self.current_vehicle_id.model_id.brand_id.id),
('id', '!=', self.current_vehicle_id.id)])
for record in model_id:
self.vehicle_ids = [(4, record.id)]
self.write({'state': 'to_approve'})
def action_approve(self):
""" Process the approval of the subscription request."""
subscription = self.env['fleet.subscription'].search(
[('vehicle_id', '=', self.current_vehicle_id.id),
('state', '=', 'subscribed')])
subscription.update({
'vehicle_id': self.new_vehicle_id,
'invisible_sub': True,
})
self.write({'state': 'approved'})
sale_order = subscription.sale_id
if sale_order.order_line:
sale_order.order_line[0].name = self.new_vehicle_id.name
invoice_ids = subscription.invoice_ids
for rec in invoice_ids:
if rec.invoice_line_ids:
rec.invoice_line_ids[0].name = self.new_vehicle_id.name
subscription.write({'sale_id': sale_order.id})
subscription.write({'invoice_ids': invoice_ids.ids})

59
vehicle_subscription/models/vehicle_insurance.py

@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Jabin MP (<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models
from odoo.exceptions import ValidationError
class VehicleInsurance(models.Model):
"""New model vehicle .insurance"""
_name = "vehicle.insurance"
_description = "Vehicle Insurance"
_inherit = "mail.thread"
_rec_name = "vehicle_id"
vehicle_id = fields.Many2one('fleet.vehicle', string="Vehicle",
help="Help you to choose vehicle",
required=True)
start_date = fields.Date(string="Start Date", help="Insurance start date",
required=True)
end_date = fields.Date(string="End Date", help="Insurance end date",
required=True)
insurance_type_id = fields.Many2one('insurance.type',
string='Insurance Type',
help="Choose insurance type")
insurance_amount = fields.Float(string="Amount",
compute="_compute_insurance_amount",
help="Calculate insurance amount")
def _compute_insurance_amount(self):
"""Function used to compute insurance amount"""
for rec in self:
rec.insurance_amount = sum(rec.insurance_type_id.coverage_ids.
mapped('coverage_price'))
@api.constrains('start_date', 'end_date')
def _check_dates(self):
"""Ensure that the start date is not greater than the end date."""
for rec in self:
if rec.start_date > rec.end_date:
raise ValidationError(
"Start Date cannot be greater than End Date")

8
vehicle_subscription/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_fleet_subscription,access.fleet.subscription,model_fleet_subscription,base.group_user,1,1,1,1
access_vehicle_insurance,access.vehicle.insurance,model_vehicle_insurance,base.group_user,1,1,1,1
access_subscription_request,access.subscription.request,model_subscription_request,base.group_user,1,1,1,1
access_change_subscription,access.change.subscription,model_change_subscription,base.group_user,1,1,1,1
access_insurance_type,access.insurance.type,model_insurance_type,base.group_user,1,1,1,1
access_insurance_coverage,access.insurance.coverage,model_insurance_coverage,base.group_user,1,1,1,1
access_cancellation_request,access.cancellation.request,model_cancellation_request,base.group_user,1,1,1,1
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 access_fleet_subscription access.fleet.subscription model_fleet_subscription base.group_user 1 1 1 1
3 access_vehicle_insurance access.vehicle.insurance model_vehicle_insurance base.group_user 1 1 1 1
4 access_subscription_request access.subscription.request model_subscription_request base.group_user 1 1 1 1
5 access_change_subscription access.change.subscription model_change_subscription base.group_user 1 1 1 1
6 access_insurance_type access.insurance.type model_insurance_type base.group_user 1 1 1 1
7 access_insurance_coverage access.insurance.coverage model_insurance_coverage base.group_user 1 1 1 1
8 access_cancellation_request access.cancellation.request model_cancellation_request base.group_user 1 1 1 1

17
vehicle_subscription/security/vehicle_subscription_groups.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--User access levels for Fleet module-->
<record id="module_vehicle_subscription" model="ir.module.category">
<field name="name">Vehicle Subscription</field>
<field name="description">User access levels for Fleet module</field>
<field name="sequence">10</field>
</record>
<record id="vehicle_subscription_group_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="module_vehicle_subscription"/>
</record>
<record id="vehicle_subscription_group_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_vehicle_subscription"/>
</record>
</odoo>

BIN
vehicle_subscription/static/description/assets/icons/capture (1).png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
vehicle_subscription/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
vehicle_subscription/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
vehicle_subscription/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
vehicle_subscription/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
vehicle_subscription/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
vehicle_subscription/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
vehicle_subscription/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
vehicle_subscription/static/description/assets/icons/img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
vehicle_subscription/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
vehicle_subscription/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
vehicle_subscription/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
vehicle_subscription/static/description/assets/icons/photo-capture.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
vehicle_subscription/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
vehicle_subscription/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
vehicle_subscription/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
vehicle_subscription/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
vehicle_subscription/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
vehicle_subscription/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
vehicle_subscription/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
vehicle_subscription/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
vehicle_subscription/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
vehicle_subscription/static/description/assets/misc/Cybrosys R.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
vehicle_subscription/static/description/assets/misc/categories.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
vehicle_subscription/static/description/assets/misc/check-box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
vehicle_subscription/static/description/assets/misc/compass.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
vehicle_subscription/static/description/assets/misc/corporate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
vehicle_subscription/static/description/assets/misc/customer-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
vehicle_subscription/static/description/assets/misc/cybrosys-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

33
vehicle_subscription/static/description/assets/misc/email.svg

@ -0,0 +1,33 @@
<svg width="80" height="81" viewBox="0 0 80 81" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="3116889_design_email_material_communication_mail_icon 1" clip-path="url(#clip0_81_366)">
<g id="layer1">
<path id="rect3851" d="M74.6067 0.730957H5.5424C2.75742 0.730957 0.499756 3.01685 0.499756 5.83664V75.7642C0.499756 78.584 2.75742 80.8699 5.5424 80.8699H74.6067C77.3916 80.8699 79.6493 78.584 79.6493 75.7642V5.83664C79.6493 3.01685 77.3916 0.730957 74.6067 0.730957Z" fill="#DB534B"/>
<g id="Clip path group">
<mask id="mask0_81_366" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="1" y="5" width="78" height="76">
<g id="clipPath4206">
<path id="rect4208" d="M73.6244 5.2915H6.62595C3.92428 5.2915 1.73413 7.4473 1.73413 10.1066V76.0546C1.73413 78.7139 3.92428 80.8697 6.62595 80.8697H73.6244C76.3261 80.8697 78.5162 78.7139 78.5162 76.0546V10.1066C78.5162 7.4473 76.3261 5.2915 73.6244 5.2915Z" fill="white"/>
</g>
</mask>
<g mask="url(#mask0_81_366)">
<g id="g4145" opacity="0.489612">
<g id="g4147">
<path id="path4149" d="M65.8115 41.5171C65.8115 54.9863 54.4292 65.9053 40.3884 65.9053L198.828 221.861C212.869 221.861 224.251 210.942 224.251 197.472L65.8115 41.5171Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4151" d="M40.3884 65.9051C33.2495 65.9051 26.7979 63.0825 22.1802 58.5371L180.62 214.492C185.237 219.038 191.689 221.86 198.828 221.86L40.3884 65.9051Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4153" d="M22.1802 58.5373C17.7157 54.1428 14.9653 48.1381 14.9653 41.5171L173.405 197.472C173.405 204.093 176.155 210.098 180.62 214.493L22.1802 58.5373Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4155" d="M14.9653 41.5171C14.9653 28.0479 26.3476 17.1289 40.3884 17.1289L198.828 173.084C184.787 173.084 173.405 184.003 173.405 197.472L14.9653 41.5171Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4157" d="M40.3884 17.1289C47.5273 17.1289 53.9789 19.9516 58.5966 24.4969L217.036 180.452C212.418 175.907 205.967 173.084 198.828 173.084L40.3884 17.1289Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4159" d="M58.5964 24.4971C63.0609 28.8916 65.8113 34.8963 65.8113 41.5173L224.251 197.473C224.251 190.852 221.5 184.847 217.036 180.452L58.5964 24.4971Z" fill="black" fill-opacity="0.0588235"/>
</g>
<path id="path4111" d="M65.8114 41.5171C65.8114 54.9863 54.4291 65.9053 40.3884 65.9053C26.3476 65.9053 14.9653 54.9863 14.9653 41.5171C14.9653 28.0479 26.3476 17.1289 40.3884 17.1289C54.4291 17.1289 65.8114 28.0479 65.8114 41.5171Z" fill="black" fill-opacity="0.0588235"/>
</g>
</g>
</g>
<path id="path3864" d="M17.506 17.5386H62.9018C64.4068 17.5386 65.8501 18.1439 66.9143 19.2214C67.9784 20.2988 68.5763 21.7602 68.5763 23.284V57.7564C68.5763 58.5109 68.4295 59.258 68.1443 59.9551C67.8592 60.6521 67.4412 61.2855 66.9143 61.819C66.3873 62.3525 65.7618 62.7757 65.0733 63.0645C64.3849 63.3532 63.647 63.5018 62.9018 63.5018H17.506C14.3567 63.5018 11.8315 60.9164 11.8315 57.7564V23.284C11.8315 20.0953 14.3567 17.5386 17.506 17.5386ZM40.2039 37.6475L62.9018 23.284H17.506L40.2039 37.6475ZM17.506 57.7564H62.9018V30.0923L40.2039 44.4271L17.506 30.0923V57.7564Z" fill="white"/>
</g>
</g>
<defs>
<clipPath id="clip0_81_366">
<rect width="80" height="81" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
vehicle_subscription/static/description/assets/misc/features.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
vehicle_subscription/static/description/assets/misc/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

3
vehicle_subscription/static/description/assets/misc/phone.svg

@ -0,0 +1,3 @@
<svg width="36" height="44" viewBox="0 0 36 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Vector" d="M7.25 19.3903C10.13 26.0689 14.76 31.5322 20.43 34.9305L24.83 29.7268C25.38 29.0778 26.17 28.889 26.86 29.1486C29.1 30.0218 31.51 30.4938 34 30.4938C35.11 30.4938 36 31.544 36 32.8537V41.1135C36 42.4233 35.11 43.4734 34 43.4734C15.22 43.4734 0 25.5143 0 3.35456C0 2.0448 0.9 0.994629 2 0.994629H9C10.11 0.994629 11 2.0448 11 3.35456C11 6.29268 11.4 9.1364 12.14 11.7795C12.36 12.5937 12.2 13.5259 11.65 14.1749L7.25 19.3903Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 565 B

BIN
vehicle_subscription/static/description/assets/misc/pictures.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
vehicle_subscription/static/description/assets/misc/pie-chart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
vehicle_subscription/static/description/assets/misc/right-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

9
vehicle_subscription/static/description/assets/misc/star (1) 2.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 26 KiB

BIN
vehicle_subscription/static/description/assets/misc/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

9
vehicle_subscription/static/description/assets/misc/support (1) 1.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 43 KiB

6
vehicle_subscription/static/description/assets/misc/support-email.svg

@ -0,0 +1,6 @@
<svg width="49" height="37" viewBox="0 0 49 37" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group">
<path id="Vector" d="M2.23798 3.59132C3.53363 4.39742 21.5313 15.9748 22.2027 16.3917C22.8741 16.8087 23.5573 17.0032 24.6173 17.0032C25.6774 17.0032 26.3606 16.8087 27.0319 16.3917C27.7033 15.9748 45.701 4.39742 46.9967 3.59132C47.4796 3.29945 48.2923 2.77131 48.469 2.17368C48.7753 1.11741 48.4455 0.714355 47.138 0.714355H24.6173H2.09664C0.789214 0.714355 0.459412 1.13131 0.765656 2.17368C0.942335 2.78521 1.75506 3.29945 2.23798 3.59132Z" fill="white"/>
<path id="Vector_2" d="M48.0214 4.21664C47.0555 4.80037 38.3865 12.0831 32.6503 16.4611L42.3323 29.3171C42.5679 29.5951 42.6739 29.9286 42.5443 30.0954C42.403 30.2483 42.0967 30.1649 41.8494 29.9008L30.2357 18.3374C28.4807 19.6716 27.2439 20.5889 27.0319 20.7279C26.1249 21.2699 25.4889 21.3394 24.6173 21.3394C23.7457 21.3394 23.1096 21.2699 22.2027 20.7279C21.9789 20.5889 20.7539 19.6716 18.9989 18.3374L7.38519 29.9008C7.14961 30.1788 6.83159 30.2622 6.69025 30.0954C6.54891 29.9425 6.65491 29.5951 6.89048 29.3171L16.5607 16.4611C10.8245 12.0831 2.06126 4.80037 1.09541 4.21664C0.0588929 3.59121 0 4.32783 0 4.89766C0 5.46749 0 33.3893 0 33.3893C0 34.6819 1.61367 36.2941 2.76797 36.2941H24.6173H46.4666C47.6209 36.2941 48.999 34.668 48.999 33.3893C48.999 33.3893 48.999 5.4536 48.999 4.89766C48.999 4.31393 49.0697 3.59121 48.0214 4.21664Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
vehicle_subscription/static/description/assets/misc/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

17
vehicle_subscription/static/description/assets/misc/tick-mark.svg

@ -0,0 +1,17 @@
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="52" height="52" fill="#F5F5F5"/>
<g clip-path="url(#clip0_0_1)">
<rect width="1440" height="7504" transform="translate(-107 -1660)" fill="white"/>
<rect x="-45" y="-203" width="1305" height="937" rx="19" fill="#FFF5FC"/>
<rect width="52" height="52" fill="url(#pattern0)"/>
</g>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_0_1" transform="scale(0.00387597)"/>
</pattern>
<clipPath id="clip0_0_1">
<rect width="1440" height="7504" fill="white" transform="translate(-107 -1660)"/>
</clipPath>
<image id="image0_0_1" width="258" height="258" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQIAAAECCAYAAAAVT9lQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAJJ0lEQVR4nO3dYZXjNhQGUDEohEAohEAohEAYCIawEAxhIQRCIQTCQmhX202bTWcmcWzpSda953y/J9JYL5EsyykBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD1/f49f37PXwXztVprgMXeUtkCkDNXaw2wyOF7zql8EXir1SBgmTw4v6XyReBUq0HA835L/8zVSxeAXGSOldoELPBHqvMrIP+N3yu1CXhS/hXwJZUvAIoANKrGbcFr8t/5rU6zgGfVWhBUBKBBtRYEFQFoVJ4KXJIiAMOqsUNQEYBG1Z4K/PXz7ykC0IjaU4GcuUrLgKecUt0CoAhAQ/JP8jwgFQEY1CHV2yCkCECDaj0rcJ8/azQOeGxK9QvAtQi4OwDBIm4NKgLQkJoPDCkC0KCo9QBFABpRe6uwIgANidofcM23pAhAqDwAo9YDrkXAyUIQKA/AqPUARQAacEqxRSBHEYBAkYuC15yKtxL40JwUARhWXhQ8p/gi4DVkEOSQYu8MXDOXbijwvug7A4oABIvcLnwbuwYhyCnFFwBFAALVet/go+RfI4fCbQXekefi0QXgWgRsGILKWrk9eM0fZZsL3It+cOg+p7LNBe5Fnib0XuayzQXutbJHQBGAIK0VAbcJobI8B2+pCDhhCCrLRSB64N8XAbcJoaLWikCO24RQ0ZTiB/19PFIMFc0pftDfZy7aYuAXLRYBLyeFilosApfkDgFU02IRcIcAKmnt4aHbuEMAFbT28NBtpoLtBn5quQh8Ldhu4KeWi4BnCKCClouAo8aggpaLQM6xXNOBrPUiYPswFNZ6EZjLNR3IWi8CFgehsNaLgMVBKKz1IpBj5yAU1EMRmIq1HuiiCNg5CAX1UAQuyeIgFNNDEfBYMRTUQxHIOZXqAKDd8wRuMxdrPdDkyUL3ceYgFNRDEbBpCArqoQjk2DQEhfRSBKZSHQCj+5LiB/gzOZfqABjdKcUP8GfibcVQSC9FIOdYqA9gaD0VgalQH8DQ8rdr9OB+NudCfQBDy/vy83w7eoA/E+sCUEBPRSDnWKYbYFz5m7WnIjCV6QYYVy9PEl5zLtMNMK7eioB1ASggf7tGD+4lOZbpBhjXnOIH9pJ8KdMNMK5enh+4xvkCsLFTih/YS+J8AdhYb0Ugx/kCsKG8YSh6UC/NXKQnaFb+h+d5oJ+AZfS2azDHy0oHk4vA9Z+fL9ZT7MfZnTyYLil+YC+N9xEM5LYI3Ca/osq3wXq9bRi65q1EZ9Cmj4rANflb7Bj26fYhF9ToQb003lM4kEdF4DZT0Gfs3ZI+biW2EA/klQvUQuIy+ad19KB+JccSnUF71nxLWUh8Tu6j6AH9SmwhHsSaInAbC4kf6/E2YY4txIPYqghcc0l+Rt47pD6LgFeXD2LrInCbqWI7WtbrbcIctwoHULIIXGMhsb9zBa5xq3AANYrANSMvJNbs563/Z9Z6di7q4hxtITEXv+gB/Wo8Vbhz0d9QlzTGQmJuY/RgfjVuFe5cdBG4zVS4rZF6vU2Yc0lj/WobTktF4Jo9LiT2fIcgx63CnWv14tzbQuI5xffpq5kK9AeNaf3n6h4WEucU34+vxu7BgZxS/AX3WS6p34XE1vv2sziAdEA9PAM/FWt9Gbl4RffZmtg9OKBejsbqZSExf8aWp1yPct6+S+hFLyfmtr6Q2PsdArsH6epwjFYXEucU3zdrYvcgP/SwXnDNJbW1kNhTIX0vHijiX72sF9xmKtITy+SCFN0Pa2JKwP/0eFFHLiTmv9vz4mDOcfNeYRemFH9xLk3EQmLvi4M5HijiU+cUf5G+kpoLiXOlNpXKJZkS8EC+QHr9yZsv8OP2XfKL3hcHc0r3ETuRL5Toi3VNpu275Ife+yXHlIBF8gUTfdGuydYLiT3/UrrtE1MCFut9QWzLhcTe+yLHGQO85JD6/xbMWbuQ2Puvo5xpRfvhx/bT6It4i1zSa4tke2i/MwbYxJziL+atMi1o9yHt4xeRKQGb2MMGmts8s5C4lzZPD9oJi/TyyPKzebSQODfwGdfGlIAi9rCZ5j7vLSTuYV0gx5SAYnp6ZPnZXNJ/C4mHtI91gend/x5sZA8baz4bPHtYFzAloIpjir/Y5eOYElDNlOIvePl/ps/+aVDCHn5G7ymmBIQ4pP2uF/QYUwLCnFL8ABBTAhowp/iBMHIuyePFNKDHU5D3lOPjfxHUsbctyL3EiUM0Z0rxA2OkXJIpAY06p/gBMkqOT/5PoLpDckuxRkwJaN5ent5rNV5VRjf2cM5fq/H2YrqxlxN+Wou3F9MdtxS3jSkB3drjqUZROS3se2jKOcUPot5zXtzr0JhDcktxTb6lbV/fBmHcUnw90wv9Dc2aU/yg6i0OG2F3PKW4PA4bYZfcUnw+04t9DF3IF3j0IGs9l2TPAAOw6/DzHF/vWujHIbml+FHmFf0K3Tml+EHXWmwjZkh7fJfimpzWdSf0ac/vUlya88q+hK4dU/wgjI5txJAcZDKt70Lo38gHmdhGDDdG3XV43KLzYE/yT+TogVkzTiOGD5xT/ACtEXsG4BOHNMYtRacRwwN7P+vwvF1Xwb7tedfhYcN+gl3b667DactOghHs7azDy7bdA+OYU/wA3irHjfsGhrGXsw7nrTsGRpO/SaMH8prYMwAb6fnBpLcC/QFD6nWK4KEi2FiPDyZ5NwEUMKX4wf1sPFQEBfVwdoEFQiishynCqVjrgX+1PEU4F2w3cKfVKcKhZKOBX7U4RZiKthh4V0tThEuyQAhhWpkiOHUIArUwRTgXbyXwUPQU4VC+icAzoqYIU43GAc+JmCJckgVCaE7tKYIFQmhUrSnCuVaDgOVqTREOtRoEvKb0FGGq1xRgjVJTBAuE0JFSU4RTzUYA6209RbBACB3a+tBTZxBCp45pmyLgDELo3Nr3IjiDEHZg7RTBAiHsxKtvV/aSEtiZr2l5ITiGfFKgmDxFyPP9Z4vAHPMxgdLyS0mfXSA8BH1GoIK8MehRIZjCPh1QxaPtx5e4jwbUlL/xPyoEDhyBQXy0t+Ac+aGA+t7bW+B5AhjQ7d4CzxPAoPItwm/J8wQwvLxw+Bb9IQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4DV/A/Mf3+pWEmbtAAAAAElFTkSuQmCC"/>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

9
vehicle_subscription/static/description/assets/misc/whatsapp 1.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 38 KiB

BIN
vehicle_subscription/static/description/assets/misc/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

33
vehicle_subscription/static/description/assets/misc/whatsapp.svg

@ -0,0 +1,33 @@
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="3116884_whatsapp_square_chat_design_message_icon 1" clip-path="url(#clip0_81_382)">
<g id="layer1">
<path id="rect3851" d="M74.6066 0.72168H5.5424C2.75742 0.72168 0.499756 2.97935 0.499756 5.76433V74.8286C0.499756 77.6135 2.75742 79.8712 5.5424 79.8712H74.6066C77.3916 79.8712 79.6492 77.6135 79.6492 74.8286V5.76433C79.6492 2.97935 77.3916 0.72168 74.6066 0.72168Z" fill="#39BB59"/>
<g id="Clip path group">
<mask id="mask0_81_382" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="6" y="9" width="75" height="72">
<g id="clipPath4206">
<path id="rect4208" d="M75.7716 9.01709H11.1629C8.55758 9.01709 6.44556 11.0471 6.44556 13.5512V75.6502C6.44556 78.1543 8.55758 80.1843 11.1629 80.1843H75.7716C78.3769 80.1843 80.4889 78.1543 80.4889 75.6502V13.5512C80.4889 11.0471 78.3769 9.01709 75.7716 9.01709Z" fill="white"/>
</g>
</mask>
<g mask="url(#mask0_81_382)">
<g id="g4145" opacity="0.489612">
<g id="g4147">
<path id="path4149" d="M68.2374 43.1284C68.2374 55.8115 57.2611 66.0932 43.7212 66.0932L196.51 212.946C210.049 212.946 221.026 202.665 221.026 189.982L68.2374 43.1284Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4151" d="M43.7211 66.0932C36.8369 66.0932 30.6154 63.4353 26.1624 59.1553L178.951 206.008C183.404 210.289 189.625 212.946 196.51 212.946L43.7211 66.0932Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4153" d="M26.1623 59.1553C21.8571 55.0173 19.2048 49.363 19.2048 43.1284L171.993 189.982C171.993 196.216 174.645 201.87 178.951 206.008L26.1623 59.1553Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4155" d="M19.2048 43.1284C19.2048 30.4453 30.1811 20.1636 43.7211 20.1636L196.509 167.017C182.969 167.017 171.993 177.299 171.993 189.982L19.2048 43.1284Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4157" d="M43.7212 20.1636C50.6054 20.1636 56.8269 22.8215 61.2799 27.1015L214.068 173.955C209.615 169.675 203.394 167.017 196.51 167.017L43.7212 20.1636Z" fill="black" fill-opacity="0.0588235"/>
<path id="path4159" d="M61.2798 27.1016C65.585 31.2396 68.2373 36.8939 68.2373 43.1284L221.026 189.982C221.026 183.747 218.373 178.093 214.068 173.955L61.2798 27.1016Z" fill="black" fill-opacity="0.0588235"/>
</g>
<path id="path4111" d="M68.2373 43.1284C68.2373 55.8115 57.261 66.0932 43.7211 66.0932C30.1811 66.0932 19.2048 55.8115 19.2048 43.1284C19.2048 30.4453 30.1811 20.1636 43.7211 20.1636C57.261 20.1636 68.2373 30.4453 68.2373 43.1284Z" fill="black" fill-opacity="0.0588235"/>
</g>
</g>
</g>
<path id="path4074" d="M51.3896 43.6875C51.9673 43.9879 52.337 44.1497 52.4526 44.3808C52.5912 44.635 52.545 45.7904 51.9673 47.1076C51.5051 48.4017 49.1018 49.6496 48.0388 49.6958C46.9758 49.7421 46.9527 50.5277 41.1985 48.0089C35.4444 45.49 31.9781 39.3431 31.7008 38.9502C31.4235 38.5574 29.4823 35.7612 29.5748 32.9188C29.6903 30.0995 31.1693 28.7592 31.7701 28.2046C32.3247 27.6037 32.9487 27.5344 33.3415 27.6037H34.4276C34.7743 27.6037 35.2596 27.4651 35.6986 28.6437L37.2931 32.965C37.4318 33.2654 37.5242 33.6121 37.3163 33.9818L36.6923 34.9293L35.7911 35.8998C35.5138 36.1771 35.1902 36.4776 35.5138 37.0553C35.7911 37.6561 36.9465 39.5741 38.5641 41.1687C40.667 43.2022 42.5158 43.8724 43.0704 44.1728C43.625 44.4963 43.9716 44.4501 44.3182 44.0804L46.1901 41.9081C46.6291 41.3304 46.9989 41.4691 47.5304 41.6539L51.3896 43.6875ZM40.4128 16.0493C46.5417 16.0493 52.4195 18.484 56.7533 22.8178C61.0871 27.1515 63.5217 33.0293 63.5217 39.1582C63.5217 45.287 61.0871 51.1649 56.7533 55.4986C52.4195 59.8324 46.5417 62.2671 40.4128 62.2671C35.8604 62.2671 31.6315 60.9498 28.0496 58.6852L17.304 62.2671L20.8858 51.5214C18.6212 47.9396 17.304 43.7106 17.304 39.1582C17.304 33.0293 19.7386 27.1515 24.0724 22.8178C28.4061 18.484 34.284 16.0493 40.4128 16.0493ZM40.4128 20.6711C35.5098 20.6711 30.8075 22.6188 27.3405 26.0858C23.8735 29.5528 21.9257 34.2551 21.9257 39.1582C21.9257 43.1329 23.1736 46.8072 25.2996 49.8114L23.0812 56.4898L29.7596 54.2714C32.7638 56.3974 36.4381 57.6453 40.4128 57.6453C45.3159 57.6453 50.0182 55.6975 53.4852 52.2305C56.9522 48.7635 58.9 44.0613 58.9 39.1582C58.9 34.2551 56.9522 29.5528 53.4852 26.0858C50.0182 22.6188 45.3159 20.6711 40.4128 20.6711Z" fill="white"/>
</g>
</g>
<defs>
<clipPath id="clip0_81_382">
<rect width="80" height="80" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
vehicle_subscription/static/description/assets/modules/1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
vehicle_subscription/static/description/assets/modules/2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
vehicle_subscription/static/description/assets/modules/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
vehicle_subscription/static/description/assets/modules/4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
vehicle_subscription/static/description/assets/modules/5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
vehicle_subscription/static/description/assets/modules/6.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/13.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/14.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/15.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/17.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/18.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/19.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
vehicle_subscription/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 KiB

BIN
vehicle_subscription/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
vehicle_subscription/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

1063
vehicle_subscription/static/description/index.html

File diff suppressed because it is too large

31
vehicle_subscription/static/src/js/change_subscription_form.js

@ -0,0 +1,31 @@
odoo.define('vehicle_subscription.subscription_change', function (require) {
"use strict";
var publicWidget = require('web.public.widget');
const ajax = require('web.ajax');
publicWidget.registry.Change = publicWidget.Widget.extend({
selector: '.change_sub_vehicle',
start: function() {
this._super.apply(this, arguments);
this._onChangeCustomer(); // Call the function initially
},
//On the onchange function customer is passed to controller
_onChangeCustomer: async function(ev){
var self=this;
var customer_id = this.$('input[name="customer"]')[0].value
awaitajax.jsonRpc('/online/choose/vehicle', "call", {
'customer_id': customer_id,
})
.then(function(result) {
const select = self.$el.find('#vehicle_change')[0];
const options = Array.from(select.options);
options.forEach((option) => {
option.remove();
});
result.forEach((item) => {
let newOption = new Option(item[1], item[0]);
select.add(newOption, undefined);
});
});
},
})
})

19
vehicle_subscription/static/src/js/change_subscription_request.js

@ -0,0 +1,19 @@
odoo.define('vehicle_subscription.subscription_submit_request', function (require) {
"use strict";
var publicWidget = require('web.public.widget');
const ajax = require('web.ajax');
//To getitem to get vehicle.
$(function() {
if (localStorage.getItem('current_vehicle')) {
$('#current_vehicle').val(localStorage.getItem('current_vehicle'));
}
});
publicWidget.registry.Request = publicWidget.Widget.extend({
selector: '.submit_boolean_on',
start: function() {
var self = this;//setitem to store the element.
var current_vehicle = self.$('#current_vehicle').val();
localStorage.setItem('current_vehicle', current_vehicle);
}
})
})

31
vehicle_subscription/static/src/js/subscription_cancellation.js

@ -0,0 +1,31 @@
odoo.define('vehicle_subscription.subscription_cancellation', function (require) {
"use strict";
var publicWidget = require('web.public.widget');
const ajax = require('web.ajax');
publicWidget.registry.Cancellation = publicWidget.Widget.extend({
selector: '.cancel_sub',
start: function() {
this._super.apply(this, arguments);
this._onChangeCustomer(); // Call the function initially
},
//On the onchange function customer is passed to controller
_onChangeCustomer: async function(ev){
var self=this;
var customer_id = this.$('input[name="customer"]')[0].value
await ajax.jsonRpc('/online/choose/vehicle', "call", {
'customer_id': customer_id,
})
.then(function(result) {
const select = self.$el.find('#vehicle_cancellation')[0];
const options = Array.from(select.options);
options.forEach((option) => {
option.remove();
});
result.forEach((item) => {
let newOption = new Option(item[1], item[0]);
select.add(newOption, undefined);
});
});
}
})
})

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save