Browse Source

[ADD] Workflow Changed

pull/29/head
SHEREEF PT 8 years ago
parent
commit
4dcbe3dd6f
  1. 24
      fleet_rental/README.rst
  2. 4
      fleet_rental/__init__.py
  3. 13
      fleet_rental/__manifest__.py
  4. 46
      fleet_rental/__manifest__.py~
  5. 9
      fleet_rental/data/fleet_rental_data.xml
  6. 3
      fleet_rental/models/__init__.py
  7. 313
      fleet_rental/models/car_rental.py
  8. 24
      fleet_rental/reports/__init__.py
  9. 103
      fleet_rental/reports/rental_report.py
  10. 25
      fleet_rental/reports/rental_report.xml
  11. 21
      fleet_rental/security/ir.model.access.csv
  12. 18
      fleet_rental/security/rental_security.xml
  13. BIN
      fleet_rental/static/description/banner.jpg
  14. BIN
      fleet_rental/static/description/check_list_form.png
  15. BIN
      fleet_rental/static/description/check_list_tree.png
  16. BIN
      fleet_rental/static/description/checklist_contract.png
  17. BIN
      fleet_rental/static/description/contract_menu.png
  18. BIN
      fleet_rental/static/description/email1.png
  19. BIN
      fleet_rental/static/description/email2.png
  20. BIN
      fleet_rental/static/description/email3.png
  21. BIN
      fleet_rental/static/description/icon.png
  22. 150
      fleet_rental/static/description/index.html
  23. 228
      fleet_rental/static/description/index.html~
  24. BIN
      fleet_rental/static/description/menu_items.png
  25. BIN
      fleet_rental/static/description/rental_inv.png
  26. BIN
      fleet_rental/static/description/rental_validation.png
  27. BIN
      fleet_rental/static/description/report.png
  28. 220
      fleet_rental/views/car_rental_view.xml
  29. 3
      fleet_rental/views/car_tools_view.xml
  30. 12
      fleet_rental/views/checklist_view.xml

24
fleet_rental/README.rst

@ -0,0 +1,24 @@
Fleet Rental Management
=======================
This module will helps you to give the vehicles for Rent.
Features
========
* Multiple Plans for Rental Contract(Days/Weeks/Months/Years).
* Integrated with Accounting Module.
* Automatically Create Recurring Invoices.
* Sending email for confirmation, first payment and recurrent invoices.
* Check List Facility.
* Separate Tree view for Checklist.
* Damage Checking Facility.
* Billing Facility for Damages/Check Lists.
* Contract Payment Validations.
* Detailed Fleet Rental Analysis Report.
* Access Rights From Multiple Level.
Credits
=======
Developer: Nilmar Shereef @ cybrosys, shereef@cybrosys.in
Developer: Jesni Banu @ cybrosys, jesni@cybrosys.in
Developer: Avinash NK @ cybrosys, avinash@cybrosys.in

4
fleet_rental/__init__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Avinash Nk(<http://www.cybrosys.com>)
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -21,3 +21,5 @@
#
##############################################################################
import models
import reports

13
fleet_rental/__manifest__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Avinash Nk(<http://www.cybrosys.com>)
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -22,16 +22,19 @@
##############################################################################
{
'name': 'Fleet Rental Management',
'summary': """This module will helps you to give the vehicles for Rent.""",
'version': '10.0.1.0.0',
'summary': """The Complete Solution for a Car/Vehicle Rental System""",
'version': '10.0.2.0.0',
'author': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
"category": "Industries",
'depends': ['account', 'fleet'],
'data': ['views/car_rental_view.xml',
'depends': ['base', 'account', 'fleet', 'mail'],
'data': ['security/rental_security.xml',
'security/ir.model.access.csv',
'views/car_rental_view.xml',
'views/checklist_view.xml',
'views/car_tools_view.xml',
'reports/rental_report.xml',
'data/fleet_rental_data.xml',
],
'demo': [

46
fleet_rental/__manifest__.py~

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Fleet Rental Management',
'summary': """This module will helps you to give the vehicles for Rent.""",
'version': '10.0.2.0.0',
'author': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
"category": "Industries",
'depends': ['base', 'account', 'fleet', 'mail'],
'data': ['security/rental_security.xml',
'security/ir.model.access.csv',
'views/car_rental_view.xml',
'views/checklist_view.xml',
'views/car_tools_view.xml',
'reports/rental_report.xml',
'data/fleet_rental_data.xml',
],
'demo': [
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'application': False,
}

9
fleet_rental/data/fleet_rental_data.xml

@ -9,5 +9,14 @@
<field name="name">Rent</field>
<field name="sequence">3</field>
</record>
<record id="fleet.fleet_rule_vehicle_visibility_user" model="ir.rule">
<field name="name">User can only see his/her vehicle</field>
<field name="model_id" ref="fleet.model_fleet_vehicle"/>
<field name="groups" eval="[(4, ref('fleet.fleet_group_user')), (4, ref('rental_group_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="False"/>
</record>
</data>
</odoo>

3
fleet_rental/models/__init__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Avinash Nk(<http://www.cybrosys.com>)
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -21,3 +21,4 @@
#
##############################################################################
import car_rental

313
fleet_rental/models/car_rental.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Avinash Nk(<http://www.cybrosys.com>)
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -22,24 +22,32 @@
##############################################################################
from datetime import datetime, date
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from odoo.exceptions import UserError, Warning
class CarRentalContract(models.Model):
_name = 'car.rental.contract'
_description = 'Fleet Rental Management'
_inherit = ['mail.thread', 'ir.needaction_mixin']
contract_name = fields.Char(string="Name", default="Draft Contract", readonly=True)
name = fields.Many2one('res.partner', required=True, help="Customer")
vehicle_id = fields.Many2one('fleet.vehicle', string="Vehicle To Rent", required=True)
car_brand = fields.Char(string="Car Brand", size=50)
car_color = fields.Char(string="Car Color", size=50)
image = fields.Binary(related='vehicle_id.image', string="Logo")
image_medium = fields.Binary(related='vehicle_id.image_medium', string="Logo (medium)")
image_small = fields.Binary(related='vehicle_id.image_small', string="Logo (small)")
name = fields.Char(string="Name", default="Draft Contract", readonly=True, copy=False)
customer_id = fields.Many2one('res.partner', required=True, string='Customer', help="Customer")
vehicle_id = fields.Many2one('fleet.vehicle', string="Vehicle", required=True, help="Vehicle")
car_brand = fields.Char(string="Fleet Brand", size=50)
car_color = fields.Char(string="Fleet Color", size=50)
cost = fields.Float(string="Rent Cost", help="This fields is to determine the cost of rent per hour", required=True)
rent_start_date = fields.Date(string="Rent Start Date", required=True, default=datetime.today())
rent_end_date = fields.Date(string="Rent End Date", required=True)
rent_start_date = fields.Date(string="Rent Start Date", required=True, default=datetime.today(),
help="Starting date of your contract", track_visibility='onchange')
rent_end_date = fields.Date(string="Rent End Date", required=True, help="Ending date of your contract",
track_visibility='onchange')
state = fields.Selection([('draft', 'Draft'), ('running', 'Running'), ('cancel', 'Cancel'),
('checking', 'Checking'), ('done', 'Done')], string="State", default="draft")
('checking', 'Checking'), ('invoice', 'Invoice'), ('done', 'Done')], string="State",
default="draft", copy=False, track_visibility='onchange')
notes = fields.Text(string="Details")
cost_generated = fields.Float('Recurring Cost',
cost_generated = fields.Float(string='Recurring Cost',
help="Costs paid at regular intervals, depending on the cost frequency")
cost_frequency = fields.Selection([('no', 'No'), ('daily', 'Daily'), ('weekly', 'Weekly'), ('monthly', 'Monthly'),
('yearly', 'Yearly')], string="Recurring Cost Frequency",
@ -48,18 +56,46 @@ class CarRentalContract(models.Model):
default=lambda self: self.env['account.journal'].search([('id', '=', 1)]))
account_type = fields.Many2one('account.account', 'Account',
default=lambda self: self.env['account.account'].search([('id', '=', 17)]))
recurring_line = fields.One2many('fleet.rental.line', 'rental_number', readonly=True)
first_payment = fields.Float(string='First Payment')
first_invoice_created = fields.Boolean(string="First Invoice Created", invisible=True)
recurring_line = fields.One2many('fleet.rental.line', 'rental_number', readonly=True, help="Recurring Invoices",
copy=False)
first_payment = fields.Float(string='First Payment', help="Advance Payment", track_visibility='onchange')
first_payment_inv = fields.Many2one('account.invoice', copy=False)
first_invoice_created = fields.Boolean(string="First Invoice Created", invisible=True, copy=False)
attachment_ids = fields.Many2many('ir.attachment', 'car_rent_checklist_ir_attachments_rel',
'rental_id', 'attachment_id', string="Attachments",
help="Images of the vehicle before contract/any attachments")
checklist_line = fields.One2many('car.rental.checklist', 'checklist_number', string="Checklist")
total = fields.Float(string="Total(Tools)", readonly=True)
tools_missing_cost = fields.Float(string="Tools missing cost", readonly=True)
damage_cost = fields.Float(string="Damage cost")
damage_cost_sub = fields.Float(string="Damage cost", readonly=True)
total_cost = fields.Float(string="Total cost", readonly=True)
checklist_line = fields.One2many('car.rental.checklist', 'checklist_number', string="Checklist", help="Check List")
total = fields.Float(string="Total(Tools)", readonly=True, copy=False)
tools_missing_cost = fields.Float(string="Tools missing cost", readonly=True, copy=False)
damage_cost = fields.Float(string="Damage cost", copy=False)
damage_cost_sub = fields.Float(string="Damage cost", readonly=True, copy=False)
total_cost = fields.Float(string="Total cost", readonly=True, copy=False)
invoice_count = fields.Integer(compute='_invoice_count', string='# Invoice', copy=False)
sales_person = fields.Many2one('res.users', string='Sales Person', default=lambda self: self.env.uid,
track_visibility='always')
@api.constrains('rent_start_date', 'rent_end_date')
def validate_dates(self):
if self.rent_end_date < self.rent_start_date:
raise Warning("Please select the valid end date.")
@api.multi
def set_to_done(self):
invoice_ids = self.env['account.invoice'].search([('origin', '=', self.name)])
f = 0
for each in invoice_ids:
if each.state != 'paid':
f = 1
break
if f == 0:
self.state = 'done'
else:
raise UserError("Some Invoices are pending")
@api.multi
def _invoice_count(self):
invoice_ids = self.env['account.invoice'].search([('origin', '=', self.name)])
self.invoice_count = len(invoice_ids)
@api.constrains('state')
def state_changer(self):
@ -108,7 +144,7 @@ class CarRentalContract(models.Model):
start_date != date.today():
temp = 1
if temp == 1 and records.cost_frequency != "no" and records.state == "running":
supplier = records.name
supplier = records.customer_id
inv_data = {
'name': supplier.name,
'reference': supplier.name,
@ -116,7 +152,7 @@ class CarRentalContract(models.Model):
'partner_id': supplier.id,
'currency_id': records.account_type.company_id.currency_id.id,
'journal_id': records.journal_type.id,
'origin': records.vehicle_id.name,
'origin': records.name,
'company_id': records.account_type.company_id.id,
'date_due': self.rent_end_date,
}
@ -148,16 +184,36 @@ class CarRentalContract(models.Model):
'invoice_id': inv_id.id,
}
inv_line_obj.create(inv_line_data)
mail_content = _(
'<h3>Reminder Recurrent Payment!</h3><br/>Hi %s, <br/> This is to remind you that the '
'recurrent payment for the '
'rental contract has to be done.'
'Please make the payment at the earliest.'
'<br/><br/>'
'Please find the details below:<br/><br/>'
'<table><tr><td>Contract Ref<td/><td> %s<td/><tr/>'
'<tr/><tr><td>Amount <td/><td> %s<td/><tr/>'
'<tr/><tr><td>Due Date <td/><td> %s<td/><tr/>'
'<tr/><tr><td>Responsible Person <td/><td> %s, %s<td/><tr/><table/>') % \
(self.customer_id.name, self.name, inv_id.amount_total, inv_id.date_due, inv_id.user_id.name,
inv_id.user_id.mobile)
main_content = {
'subject': "Reminder Recurrent Payment!",
'author_id': self.env.user.partner_id.id,
'body_html': mail_content,
'email_to': self.customer_id.email,
}
self.env['mail.mail'].create(main_content).send()
else:
records.state = "checking"
@api.multi
def action_verify(self):
self.state = "done"
self.state = "invoice"
if self.total_cost != 0:
inv_obj = self.env['account.invoice']
inv_line_obj = self.env['account.invoice.line']
supplier = self.name
supplier = self.customer_id
inv_data = {
'name': supplier.name,
'reference': supplier.name,
@ -165,7 +221,7 @@ class CarRentalContract(models.Model):
'partner_id': supplier.id,
'currency_id': self.account_type.company_id.currency_id.id,
'journal_id': self.journal_type.id,
'origin': self.vehicle_id.name,
'origin': self.name,
'company_id': self.account_type.company_id.id,
'date_due': self.rent_end_date,
}
@ -217,8 +273,24 @@ class CarRentalContract(models.Model):
sequence_code = 'car.rental.sequence'
order_date = self.create_date
order_date = order_date[0:10]
self.contract_name = self.env['ir.sequence']\
self.name = self.env['ir.sequence']\
.with_context(ir_sequence_date=order_date).next_by_code(sequence_code)
mail_content = _('<h3>Order Confirmed!</h3><br/>Hi %s, <br/> This is to notify that your rental contract has '
'been confirmed. <br/><br/>'
'Please find the details below:<br/><br/>'
'<table><tr><td>Reference Number<td/><td> %s<td/><tr/>'
'<tr><td>Time Range <td/><td> %s to %s <td/><tr/><tr><td>Vehicle <td/><td> %s<td/><tr/>'
'<tr><td>Point Of Contact<td/><td> %s , %s<td/><tr/><table/>') % \
(self.customer_id.name, self.name, self.rent_start_date, self.rent_end_date,
self.vehicle_id.name, self.sales_person.name, self.sales_person.mobile)
main_content = {
'subject': _('Confirmed: %s - %s') %
(self.name, self.vehicle_id.name),
'author_id': self.env.user.partner_id.id,
'body_html': mail_content,
'email_to': self.customer_id.email,
}
self.env['mail.mail'].create(main_content).send()
@api.multi
def action_cancel(self):
@ -228,64 +300,125 @@ class CarRentalContract(models.Model):
def force_checking(self):
self.state = "checking"
@api.multi
def action_view_invoice(self):
inv_obj = self.env['account.invoice'].search([('origin', '=', self.name)])
inv_ids = []
for each in inv_obj:
inv_ids.append(each.id)
view_id = self.env.ref('account.invoice_form').id
if inv_ids:
if len(inv_ids) <= 1:
value = {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.invoice',
'view_id': view_id,
'type': 'ir.actions.act_window',
'name': _('Invoice'),
'res_id': inv_ids and inv_ids[0]
}
else:
value = {
'domain': str([('id', 'in', inv_ids)]),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.invoice',
'view_id': False,
'type': 'ir.actions.act_window',
'name': _('Invoice'),
'res_id': inv_ids
}
return value
@api.multi
def action_invoice_create(self):
self.first_invoice_created = True
inv_obj = self.env['account.invoice']
inv_line_obj = self.env['account.invoice.line']
supplier = self.name
inv_data = {
'name': supplier.name,
'reference': supplier.name,
'account_id': supplier.property_account_payable_id.id,
'partner_id': supplier.id,
'currency_id': self.account_type.company_id.currency_id.id,
'journal_id': self.journal_type.id,
'origin': self.vehicle_id.name,
'company_id': self.account_type.company_id.id,
'date_due': self.rent_end_date,
}
inv_id = inv_obj.create(inv_data)
product_id = self.env['product.product'].search([("name", "=", "Fleet Rental Service")])
if product_id.property_account_income_id.id:
income_account = product_id.property_account_income_id.id
elif product_id.categ_id.property_account_income_categ_id.id:
income_account = product_id.categ_id.property_account_income_categ_id.id
else:
raise UserError(
_('Please define income account for this product: "%s" (id:%d).') % (product_id.name,
product_id.id))
inv_line_data = {
'name': self.vehicle_id.name,
'account_id': income_account,
'price_unit': self.first_payment,
'quantity': 1,
'product_id': product_id.id,
'invoice_id': inv_id.id,
}
inv_line_obj.create(inv_line_data)
imd = self.env['ir.model.data']
action = imd.xmlid_to_object('account.action_invoice_tree1')
list_view_id = imd.xmlid_to_res_id('account.invoice_tree')
form_view_id = imd.xmlid_to_res_id('account.invoice_form')
result = {
'name': action.name,
'help': action.help,
'type': 'ir.actions.act_window',
'views': [[list_view_id, 'tree'], [form_view_id, 'form'], [False, 'graph'], [False, 'kanban'],
[False, 'calendar'], [False, 'pivot']],
'target': action.target,
'context': action.context,
'res_model': 'account.invoice',
}
if len(inv_id) > 1:
result['domain'] = "[('id','in',%s)]" % inv_id.ids
elif len(inv_id) == 1:
result['views'] = [(form_view_id, 'form')]
result['res_id'] = inv_id.ids[0]
for each in self:
rent_date = datetime.strptime(each.rent_start_date, "%Y-%m-%d").date()
if each.cost_frequency != 'no' and rent_date < date.today():
rental_days = (date.today() - rent_date).days
for each1 in range(1, rental_days):
each.fleet_scheduler()
recurrent_obj = self.env.ref('fleet_rental.cron_scheduler_for_fleet')
if datetime.today() > datetime.strptime(recurrent_obj.nextcall, "%Y-%m-%d %H:%M:%S"):
each.fleet_scheduler()
if self.first_payment != 0:
self.first_invoice_created = True
inv_obj = self.env['account.invoice']
inv_line_obj = self.env['account.invoice.line']
supplier = self.customer_id
inv_data = {
'name': supplier.name,
'reference': supplier.name,
'account_id': supplier.property_account_payable_id.id,
'partner_id': supplier.id,
'currency_id': self.account_type.company_id.currency_id.id,
'journal_id': self.journal_type.id,
'origin': self.name,
'company_id': self.account_type.company_id.id,
'date_due': self.rent_end_date,
}
inv_id = inv_obj.create(inv_data)
self.first_payment_inv = inv_id.id
product_id = self.env['product.product'].search([("name", "=", "Fleet Rental Service")])
if product_id.property_account_income_id.id:
income_account = product_id.property_account_income_id.id
elif product_id.categ_id.property_account_income_categ_id.id:
income_account = product_id.categ_id.property_account_income_categ_id.id
else:
raise UserError(
_('Please define income account for this product: "%s" (id:%d).') % (product_id.name,
product_id.id))
inv_line_data = {
'name': self.vehicle_id.name,
'account_id': income_account,
'price_unit': self.first_payment,
'quantity': 1,
'product_id': product_id.id,
'invoice_id': inv_id.id,
}
inv_line_obj.create(inv_line_data)
inv_id.action_invoice_open()
mail_content = _(
'<h3>First Payment Received!</h3><br/>Hi %s, <br/> This is to notify that your first payment has '
'been received. <br/><br/>'
'Please find the details below:<br/><br/>'
'<table><tr><td>Invoice Number<td/><td> %s<td/><tr/>'
'<tr><td>Date<td/><td> %s <td/><tr/><tr><td>Amount <td/><td> %s<td/><tr/><table/>') % \
(self.customer_id.name, inv_id.number, inv_id.date_invoice, inv_id.amount_total)
main_content = {
'subject': _('Payment Received: %s') % inv_id.number,
'author_id': self.env.user.partner_id.id,
'body_html': mail_content,
'email_to': self.customer_id.email,
}
self.env['mail.mail'].create(main_content).send()
imd = self.env['ir.model.data']
action = imd.xmlid_to_object('account.action_invoice_tree1')
list_view_id = imd.xmlid_to_res_id('account.invoice_tree')
form_view_id = imd.xmlid_to_res_id('account.invoice_form')
result = {
'name': action.name,
'help': action.help,
'type': 'ir.actions.act_window',
'views': [[list_view_id, 'tree'], [form_view_id, 'form'], [False, 'graph'], [False, 'kanban'],
[False, 'calendar'], [False, 'pivot']],
'target': action.target,
'context': action.context,
'res_model': 'account.invoice',
}
if len(inv_id) > 1:
result['domain'] = "[('id','in',%s)]" % inv_id.ids
elif len(inv_id) == 1:
result['views'] = [(form_view_id, 'form')]
result['res_id'] = inv_id.ids[0]
else:
result = {'type': 'ir.actions.act_window_close'}
return result
else:
result = {'type': 'ir.actions.act_window_close'}
return result
raise Warning("Please enter advance amount to make first payment")
@api.onchange('vehicle_id')
def update_fields(self):
@ -302,23 +435,25 @@ class FleetRentalLine(models.Model):
date_today = fields.Date('Date')
account_info = fields.Char('Account')
recurring_amount = fields.Float('Amount')
rental_number = fields.Integer('Rental Number')
payment_info = fields.Char(string='Payment Stage', compute='paid_info')
rental_number = fields.Many2one('car.rental.contract', string='Rental Number')
payment_info = fields.Char(compute='paid_info', string='Payment Stage', default='draft')
invoice_number = fields.Integer(string='Invoice ID')
@api.one
@api.multi
@api.depends('payment_info')
def paid_info(self):
if self.env['account.invoice'].browse(self.invoice_number):
self.payment_info = self.env['account.invoice'].browse(self.invoice_number).state
else:
self.payment_info = 'Record Deleted'
for each in self:
if self.env['account.invoice'].browse(each.invoice_number):
each.payment_info = self.env['account.invoice'].browse(each.invoice_number).state
else:
each.payment_info = 'Record Deleted'
class CarRentalChecklist(models.Model):
_name = 'car.rental.checklist'
name = fields.Many2one('car.tools', string="Name")
checklist_active = fields.Boolean(string="Active", default=True)
checklist_active = fields.Boolean(string="Active", default=False)
checklist_number = fields.Many2one('car.rental.contract', string="Checklist number")
price = fields.Float(string="Price")

24
fleet_rental/reports/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import rental_report

103
fleet_rental/reports/rental_report.py

@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, tools
class FleetRentalReport(models.Model):
_name = "report.fleet.rental"
_description = "Fleet Rental Analysis"
_auto = False
name = fields.Char(string="Name")
customer_id = fields.Many2one('res.partner')
vehicle_id = fields.Many2one('fleet.vehicle')
car_brand = fields.Char(string="Car Brand")
car_color = fields.Char(string="Car Color")
cost = fields.Float(string="Rent Cost")
rent_start_date = fields.Date(string="Rent Start Date")
rent_end_date = fields.Date(string="Rent End Date")
state = fields.Selection([('draft', 'Draft'), ('running', 'Running'), ('cancel', 'Cancel'),
('checking', 'Checking'), ('done', 'Done')], string="State")
cost_frequency = fields.Selection([('no', 'No'), ('daily', 'Daily'), ('weekly', 'Weekly'), ('monthly', 'Monthly'),
('yearly', 'Yearly')], string="Recurring Cost Frequency")
total = fields.Float(string="Total(Tools)")
tools_missing_cost = fields.Float(string="Tools missing cost")
damage_cost = fields.Float(string="Damage cost")
damage_cost_sub = fields.Float(string="Damage cost")
total_cost = fields.Float(string="Total cost")
_order = 'name desc'
def _select(self):
select_str = """
SELECT
(select 1 ) AS nbr,
t.id as id,
t.name as name,
t.car_brand as car_brand,
t.customer_id as customer_id,
t.vehicle_id as vehicle_id,
t.car_color as car_color,
t.cost as cost,
t.rent_start_date as rent_start_date,
t.rent_end_date as rent_end_date,
t.state as state,
t.cost_frequency as cost_frequency,
t.total as total,
t.tools_missing_cost as tools_missing_cost,
t.damage_cost as damage_cost,
t.damage_cost_sub as damage_cost_sub,
t.total_cost as total_cost
"""
return select_str
def _group_by(self):
group_by_str = """
GROUP BY
t.id,
name,
car_brand,
customer_id,
vehicle_id,
car_color,
cost,
rent_start_date,
rent_end_date,
state,
cost_frequency,
total,
tools_missing_cost,
damage_cost,
damage_cost_sub,
total_cost
"""
return group_by_str
def init(self):
tools.sql.drop_view_if_exists(self._cr, 'report_fleet_rental')
self._cr.execute("""
CREATE view report_fleet_rental as
%s
FROM car_rental_contract t
%s
""" % (self._select(), self._group_by()))

25
fleet_rental/reports/rental_report.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="view_report_car_rental" model="ir.ui.view">
<field name="name">report.fleet.rental.pivot</field>
<field name="model">report.fleet.rental</field>
<field name="arch" type="xml">
<pivot string="Fleet Rental Analysis" display_quantity="true" disable_linking="True">
<field name="name" type="row"/>
</pivot>
</field>
</record>
<record id="action_fleet_rental_analysis" model="ir.actions.act_window">
<field name="name">Fleet Rental Analysis</field>
<field name="res_model">report.fleet.rental</field>
<field name="view_type">form</field>
<field name="view_mode">pivot</field>
<field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
<field name="help">This report allows you to analyse the performance of your Fleet Rental. </field>
</record>
<menuitem name="Fleet Rental Analysis" action="action_fleet_rental_analysis" id="menu_fleet_rental_analysis" parent="fleet.menu_fleet_reporting" sequence="1"/>
</data>
</odoo>

21
fleet_rental/security/ir.model.access.csv

@ -0,0 +1,21 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
fleet_car_rental_contract_access_right_user,fleet_car_rental_contract_access_right,model_car_rental_contract,rental_group_user,1,1,1,0
fleet_car_rental_contract_access_right_manager,fleet_car_rental_contract_access_right1,model_car_rental_contract,fleet.fleet_group_manager,1,1,1,1
fleet_fleet_rental_line_access_right_user,fleet_fleet_rental_line_access_right,model_fleet_rental_line,rental_group_user,1,1,1,0
fleet_fleet_rental_line_access_right_manager,fleet_fleet_rental_line_access_right1,model_fleet_rental_line,fleet.fleet_group_manager,1,1,1,1
fleet_car_rental_checklist_access_right_user,fleet_car_rental_checklist_access_right,model_car_rental_checklist,rental_group_user,1,1,1,0
fleet_car_rental_checklist_access_right_manager,fleet_car_rental_checklist_access_right1,model_car_rental_checklist,fleet.fleet_group_manager,1,1,1,1
fleet_car_tools_access_right_user,fleet_car_tools_access_right,model_car_tools,rental_group_user,1,1,1,0
fleet_car_tools_contract_access_right_manager,fleet_car_tools_access_right1,model_car_tools,fleet.fleet_group_manager,1,1,1,1
fleet_report_fleet_rental_access_right_user,fleet_report_fleet_rental_access_right,model_report_fleet_rental,rental_group_user,1,1,1,0
fleet_report_fleet_rental_access_right_manager,fleet_report_fleet_rental_access_right1,model_report_fleet_rental,fleet.fleet_group_manager,1,1,1,1
fleet_cron_right_user,fleet_vehicle_access_right1,base.model_ir_cron,rental_group_user,1,1,1,0
fleet_cron_right_user1,fleet_vehicle_access_right11,base.model_ir_cron,fleet.fleet_group_manager,1,1,1,0
fleet_vehicle_model_access_right_user,fleet_vehicle_model_access_right,fleet.model_fleet_vehicle_model,rental_group_user,1,1,1,0
fleet_vehicle_model_brand_access_right_user,fleet_vehicle_model_brand_access_right,fleet.model_fleet_vehicle_model_brand,rental_group_user,1,1,1,0
fleet_vehicle_access_right_user,fleet_vehicle_access_right,fleet.model_fleet_vehicle,rental_group_user,1,1,1,0
fleet_vehicle_access_right_user1,fleet_vehicle_access_right,fleet.model_fleet_vehicle,fleet.fleet_group_user,1,1,1,0
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 fleet_car_rental_contract_access_right_user fleet_car_rental_contract_access_right model_car_rental_contract rental_group_user 1 1 1 0
3 fleet_car_rental_contract_access_right_manager fleet_car_rental_contract_access_right1 model_car_rental_contract fleet.fleet_group_manager 1 1 1 1
4 fleet_fleet_rental_line_access_right_user fleet_fleet_rental_line_access_right model_fleet_rental_line rental_group_user 1 1 1 0
5 fleet_fleet_rental_line_access_right_manager fleet_fleet_rental_line_access_right1 model_fleet_rental_line fleet.fleet_group_manager 1 1 1 1
6 fleet_car_rental_checklist_access_right_user fleet_car_rental_checklist_access_right model_car_rental_checklist rental_group_user 1 1 1 0
7 fleet_car_rental_checklist_access_right_manager fleet_car_rental_checklist_access_right1 model_car_rental_checklist fleet.fleet_group_manager 1 1 1 1
8 fleet_car_tools_access_right_user fleet_car_tools_access_right model_car_tools rental_group_user 1 1 1 0
9 fleet_car_tools_contract_access_right_manager fleet_car_tools_access_right1 model_car_tools fleet.fleet_group_manager 1 1 1 1
10 fleet_report_fleet_rental_access_right_user fleet_report_fleet_rental_access_right model_report_fleet_rental rental_group_user 1 1 1 0
11 fleet_report_fleet_rental_access_right_manager fleet_report_fleet_rental_access_right1 model_report_fleet_rental fleet.fleet_group_manager 1 1 1 1
12 fleet_cron_right_user fleet_vehicle_access_right1 base.model_ir_cron rental_group_user 1 1 1 0
13 fleet_cron_right_user1 fleet_vehicle_access_right11 base.model_ir_cron fleet.fleet_group_manager 1 1 1 0
14 fleet_vehicle_model_access_right_user fleet_vehicle_model_access_right fleet.model_fleet_vehicle_model rental_group_user 1 1 1 0
15 fleet_vehicle_model_brand_access_right_user fleet_vehicle_model_brand_access_right fleet.model_fleet_vehicle_model_brand rental_group_user 1 1 1 0
16 fleet_vehicle_access_right_user fleet_vehicle_access_right fleet.model_fleet_vehicle rental_group_user 1 1 1 0
17 fleet_vehicle_access_right_user1 fleet_vehicle_access_right fleet.model_fleet_vehicle fleet.fleet_group_user 1 1 1 0

18
fleet_rental/security/rental_security.xml

@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<odoo>
<data>
<record id="rental_group_user" model="res.groups">
<field name="name">Rental User</field>
<field name="category_id" ref="fleet.module_fleet_category"/>
<field name="implied_ids" eval="[(4, ref('base.group_user')), (4, ref('fleet.fleet_group_user')),
(4, ref('account.group_account_user'))]"/>
</record>
<record id="fleet.fleet_group_manager" model="res.groups">
<field name="name">Manager</field>
<field name="implied_ids" eval="[(4, ref('fleet.fleet_group_user')), (4, ref('rental_group_user'))]"/>
<field name="category_id" ref="fleet.module_fleet_category"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
</data>
</odoo>

BIN
fleet_rental/static/description/banner.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 137 KiB

BIN
fleet_rental/static/description/check_list_form.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 87 KiB

BIN
fleet_rental/static/description/check_list_tree.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 77 KiB

BIN
fleet_rental/static/description/checklist_contract.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 112 KiB

BIN
fleet_rental/static/description/contract_menu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 114 KiB

BIN
fleet_rental/static/description/email1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
fleet_rental/static/description/email2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
fleet_rental/static/description/email3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
fleet_rental/static/description/icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 66 KiB

150
fleet_rental/static/description/index.html

@ -1,17 +1,23 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Fleet Rental Management</h2>
<h2 class="oe_slogan">Fleet/Vehicle Rental Management</h2>
<h3 class="oe_slogan">This module helps with an opportunity to give the vehicles for Rent.</h3>
<h4 class="oe_slogan" style="font-size: 23px;">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Multiple Plans for Rental Contract(Days/Weeks/Months/Years).<br/>
<span style="color:green;"> &#9745; </span> Integrated with Accounting Module.<br/>
<span style="color:green;"> &#9745; </span> Automatically Create Recurring Invoices.<br/>
<span style="color:green;"> &#9745; </span> Check list Facility.<br/>
<span style="color:green;"> &#9745; </span> Sending email for confirmation, first payment and recurrent invoices.<br/>
<span style="color:green;"> &#9745; </span> Check List Facility.<br/>
<span style="color:green;"> &#9745; </span> Separate Tree view for Checklist.<br/>
<span style="color:green;"> &#9745; </span> Damage Checking Facility.<br/>
<span style="color:green;"> &#9745; </span> Billing Facility for Damages/Check Lists.<br/>
<span style="color:green;"> &#9745; </span> Contract Payment Validations.<br/>
<span style="color:green;"> &#9745; </span> Detailed Fleet Rental Analysis Report.<br/>
<span style="color:green;"> &#9745; </span> Access Rights From Multiple Level.<br/>
</div>
</div>
</section>
@ -20,42 +26,49 @@
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">
This module is an extension to the fleet module which helps
with an opportunity to rent your car. Currently fleet module
does not have connection with accounting module. But in this
module, we integrate the module with accounting.
<p class="oe_mt32" style="text-align: center;">
This module is an application for Vehicle Rental System by Cybrosys Technologies which helps in managing the rental of fleet/vehicle.
It manages fleet/vehicle property by extending the basic fleet module of Odoo.
Currently fleet module does not have any connection with accounting module. But in this module,
we integrate the module with accounting also.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Menu</h3>
<h3 class="oe_slogan">Fleet Rental Management</h3>
<div style="text-align: center">
<p>
<h4>Fleet -> Rental Management</h4>
<h4>Fleet Rental -> Rental Management</h4>
<p>
</div>
<div>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="menu_items.png">
</div>
<span style="text-align: center">&#9755; When you install the module, an extra menu
Rental Management created under Fleet Menu.</span>
<div style="text-align: center">
<a href="https://www.cybrosys.com">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="menu_items.png">
</div>
</a>
<span style="text-align: center;padding-left:65px;">&#9755; When you install the module, an extra menu named Rental Management is created
under the Fleet Menu. Also "Fleet" menu is replaced as "Fleet Rental". Here you can see different color
codes according to each state. This helps you in finding out contracts easily.</span>
</div>
<br>
<div class="" style="text-align: center">
<div class="" style="text-align: center">
<p>
<h4>Fleet -> Rental Management -> Rental Contract</h4>
<h4>Fleet Rental -> Rental Management -> Rental Contract</h4>
<p>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="contract_menu.png">
</div>
<span>&#9755; This is the Rental Contract form. you can see the Recurring
lines created according to the Recurring cost</span>
<div style="padding-left:65px;">
<span>&#9755; This is the Rental Contract form. You can see the Recurring lines created according to
the Recurring cost. And also you can see all the invoices related to this contract from the smart
button "Invoices".</span>
</div>
</div>
</div>
</section>
@ -71,14 +84,13 @@
</div>
<br>
<div class="" style="text-align: center">
<div class="" style="text-align: center">
<div class="" style="text-align: center;padding-left:65px;">
<p>
Here you can add the list of tools given with the vehicle.
When the vehicle is returned back, the checklist can be validated
and helps you to identify the tools that are not returned.
The price of unreturned tools will be added to the missing tool cost.
The renter have to pay that amount and you can also add damage cost if any.
Check the damages by using the images of vehicle uploaded before the contract.
Here you can add the list of tools given with the vehicle.
When the vehicle is returned back, the checklist can be validated and helps you to identify the
tools that are not returned. The price of unreturned tools will be added to the missing tool cost.
The renter have to pay that amount and you can also add damage cost if any. Check the damages by
using the images of vehicle uploaded before the contract.
<p>
</div>
</div>
@ -88,7 +100,7 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Checklist Easy Access</h3>
<div>
<div style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="check_list_tree.png">
</div>
@ -98,17 +110,95 @@
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="check_list_form.png">
</div>
<span>&#9755;
<div style="padding-left:65px;">
<span>
You can also create invoice against the checklist from here.
The checklists are those which are in the checking state,
that means the ones ready for checking the operation.
If there is any damage or any missing tool, then you can
charge that from customer.</span>
If there is any damage or any missing tool, then you can charge all that from customer.</span>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Email Notifications</h3>
<div class="">
<div style="padding-left:65px;">
<span>
&#9755;The system will send email notification to notify the confirmation of contract.<br/>
&#9755;The system will notify the first payment through email.<br/>
&#9755;The system will remind all recurrent invoices through email.<br/>
<I>Note:- You should configure outgoing and incoming e-mail settings from your odoo for email service.</I>
</span>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email3.png">
</div>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email2.png">
</div>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email1.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Contract Payment Validations</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="rental_inv.png">
</div>
<div style="padding-left:65px;">
<span>&#9755;
Here you can see you have 4 invoices and this contract is in 'Invoice' state.
So you can set this contract to done only if all the invoices are in 'paid' state.
Otherwise it will raise a warning as follow.
</span>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="rental_validation.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Fleet Rental Analysis Report</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="report.png">
</div>
<span>&#9755;
You can also analyse all your fleet rentals from Fleet Rental -> Reports -> Fleet Rental Analysis.
</span>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Access Rights</h3>
<div class="" style="padding-left:65px;">
<span>&#9755;Fleet Manager :- Fleet manager has the complete access across the fleet rental management <br/></span>
<span>&#9755;Fleet Rental User :- Fleet rental user can read, write and create the records.</span>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>

228
fleet_rental/static/description/index.html~

@ -0,0 +1,228 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Fleet/Vehicle Rental Management</h2>
<h3 class="oe_slogan">This module helps with an opportunity to give the vehicles for Rent.</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Multiple Plans for Rental Contract(Days/Weeks/Months/Years).<br/>
<span style="color:green;"> &#9745; </span> Integrated with Accounting Module.<br/>
<span style="color:green;"> &#9745; </span> Automatically Create Recurring Invoices.<br/>
<span style="color:green;"> &#9745; </span> Sending email for confirmation, first payment and recurrent invoices.<br/>
<span style="color:green;"> &#9745; </span> Check List Facility.<br/>
<span style="color:green;"> &#9745; </span> Separate Tree view for Checklist.<br/>
<span style="color:green;"> &#9745; </span> Damage Checking Facility.<br/>
<span style="color:green;"> &#9745; </span> Billing Facility for Damages/Check Lists.<br/>
<span style="color:green;"> &#9745; </span> Contract Payment Validations.<br/>
<span style="color:green;"> &#9745; </span> Detailed Fleet Rental Analysis Report.<br/>
<span style="color:green;"> &#9745; </span> Access Rights From Multiple Level.<br/>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32" style="text-align: center;">
This module is an application for Vehicle Rental System which helps in managing the rental of fleet/vehicle.
It manages fleet/vehicle property by extending the basic fleet module of Odoo.
Currently fleet module does not have any connection with accounting module. But in this module,
we integrate the module with accounting also.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Fleet Rental Management</h3>
<div style="text-align: center">
<p>
<h4>Fleet Rental -> Rental Management</h4>
<p>
</div>
<div style="text-align: center">
<a href="https://www.cybrosys.com">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="menu_items.png">
</div>
</a>
<span style="text-align: center;padding-left:65px;">&#9755; When you install the module, an extra menu named Rental Management is created
under the Fleet Menu. Also "Fleet" menu is replaced as "Fleet Rental". Here you can see different color
codes according to each state. This helps you in finding out contracts easily.</span>
</div>
<br>
<div class="" style="text-align: center">
<div class="" style="text-align: center">
<p>
<h4>Fleet Rental -> Rental Management -> Rental Contract</h4>
<p>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="contract_menu.png">
</div>
<div style="padding-left:65px;">
<span>&#9755; This is the Rental Contract form. You can see the Recurring lines created according to
the Recurring cost. And also you can see all the invoices related to this contract from the smart
button "Invoices".</span>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Checklist</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="checklist_contract.png">
</div>
<span>&#9755; Checklist Tab in Rental Contract Form.</span>
</div>
<br>
<div class="" style="text-align: center">
<div class="" style="text-align: center;padding-left:65px;">
<p>
Here you can add the list of tools given with the vehicle.
When the vehicle is returned back, the checklist can be validated and helps you to identify the
tools that are not returned. The price of unreturned tools will be added to the missing tool cost.
The renter have to pay that amount and you can also add damage cost if any. Check the damages by
using the images of vehicle uploaded before the contract.
<p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Checklist Easy Access</h3>
<div style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="check_list_tree.png">
</div>
<span style="text-align: center">&#9755; No need to open all rental contract to see the checklist.</span>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="check_list_form.png">
</div>
<div style="padding-left:65px;">
<span>
You can also create invoice against the checklist from here.
The checklists are those which are in the checking state,
that means the ones ready for checking the operation.
If there is any damage or any missing tool, then you can charge all that from customer.</span>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Email Notifications</h3>
<div class="">
<div style="padding-left:65px;">
<span>
&#9755;The system will send email notification to notify the confirmation of contract.<br/>
&#9755;The system will notify the first payment through email.<br/>
&#9755;The system will remind all recurrent invoices through email.<br/>
<I>Note:- You should configure outgoing and incoming e-mail settings from your odoo for email service.</I>
</span>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email3.png">
</div>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email2.png">
</div>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="email1.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Contract Payment Validations</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="rental_inv.png">
</div>
<div style="padding-left:65px;">
<span>&#9755;
Here you can see you have 4 invoices and this contract is in 'Invoice' state.
So you can set this contract to done only if all the invoices are in 'paid' state.
Otherwise it will raise a warning as follow.
</span>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="rental_validation.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Fleet Rental Analysis Report</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height:400px;" src="report.png">
</div>
<span>&#9755;
You can also analyse all your fleet rentals from Fleet Rental -> Reports -> Fleet Rental Analysis.
</span>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Access Rights</h3>
<div class="" style="padding-left:65px;">
<span>&#9755;Fleet Manager :- Fleet manager has the complete access across the fleet rental management <br/></span>
<span>&#9755;Fleet Rental User :- Fleet rental user can read, write and create the records.</span>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
fleet_rental/static/description/menu_items.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 104 KiB

BIN
fleet_rental/static/description/rental_inv.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
fleet_rental/static/description/rental_validation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
fleet_rental/static/description/report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

220
fleet_rental/views/car_rental_view.xml

@ -11,6 +11,7 @@
<field name="padding">4</field>
</record>
</data>
<data>
<record id="cron_scheduler_for_fleet" model="ir.cron">
<field name="name">Fleet scheduler</field>
@ -22,6 +23,7 @@
<field eval="'car.rental.contract'" name="model"/>
<field eval="'fleet_scheduler'" name="function"/>
</record>
<record id="car_rental_contract_form_view" model="ir.ui.view">
<field name="name">car.contract.result.form</field>
<field name="model">car.rental.contract</field>
@ -39,114 +41,143 @@
<button name="force_checking" string="Force Checking"
attrs="{'invisible': ['|',('state','!=','running'),
('first_invoice_created','=',False)]}" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,running"/>
<button name="set_to_done" string="Set to Done"
states="invoice" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,running,done"/>
</header>
<sheet>
<h1>
<field name="contract_name"/>
</h1>
<group>
<separator string="Contract Details " colspan="4" />
<group>
<field name="name" string="Renter"/>
<field name="vehicle_id" domain="[('state_id', '!=', 'Rent')]"/>
<label for="cost_generated"/>
<div>
<field name="cost_frequency" class="oe_inline"/>
<field name="cost_generated" style="width:142px;"
attrs="{'invisible': [('cost_frequency','=','no')]}"/>
<div class="oe_right oe_button_box" style="width: 300px;" name="buttons">
<button name='action_view_invoice' class="oe_stat_button" type="object" icon="fa-money">
<field string="Invoice" name="invoice_count" widget="statinfo" />
</button>
</div>
<field name="image_medium" widget='image' class="oe_avatar"/>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<separator string="Contract Details " colspan="4" />
<group>
<field name="customer_id" string="Customer"
attrs="{'readonly': [('state','!=','draft')]}"/>
<field name="vehicle_id" domain="[('state_id', 'not in', ('Rent', 'Sold', 'Inactive'))]"
attrs="{'readonly': [('state','!=','draft')]}" widget="selection"/>
<label for="cost_generated"/>
<div>
<field name="cost_frequency" class="oe_inline"
attrs="{'readonly': [('state','!=','draft')]}"/>
<field name="cost_generated" style="width:142px;"
attrs="{'invisible': [('cost_frequency','=','no')],
'readonly': [('state','!=','draft')]}"/>
</div>
<field name="journal_type" invisible="1" />
</group>
<group>
<field name="car_brand"/>
<field name="car_color"/>
<field name="first_invoice_created" invisible="1"/>
<field name="first_payment"/>
<field name="account_type" invisible="1"/>
</group>
</group>
<group>
<separator string="Rental Information"/>
<group colspan="2">
<group>
<field name="rent_start_date"/>
</group>
<group>
<field name="rent_end_date"/>
<field name="cost" invisible="1"/>
</group>
</div>
<field name="journal_type" invisible="1" />
<field name="sales_person" attrs="{'readonly': [('state','!=','draft')]}"/>
</group>
<group>
<field name="car_brand" attrs="{'readonly': [('state','!=','draft')]}"/>
<field name="car_color" attrs="{'readonly': [('state','!=','draft')]}"/>
<field name="first_invoice_created" invisible="1"/>
<label for="first_payment"/>
<div>
<field name="first_payment" class="oe_inline"
attrs="{'readonly': ['|', ('state','not in',('draft', 'running')),
('first_invoice_created','=',True)]}"/>
<field name="first_payment_inv" style="width:142px;" readonly="1"/>
</div>
<field name="account_type" invisible="1"/>
</group>
</group>
</group>
<notebook>
<page string="Recurring Lines">
<field name="recurring_line" mode="tree">
<tree string="Fleet Reccurring Lines"
colors="#0b7a35:payment_info=='paid';#f20b07:payment_info!='paid'">
<field name="date_today"/>
<field name="name"/>
<field name="account_info"/>
<field name="recurring_amount"/>
<field name="payment_info"/>
</tree>
</field>
</page>
<page string="Checklist">
<group>
<separator string="Rental Information"/>
<group colspan="2">
<group>
<group>
<field name="attachment_ids" widget="many2many_binary" class="oe_inline"/>
</group>
<group>
<field name="damage_cost" attrs="{'invisible': [('state','!=','checking')]}"/>
</group>
<field name="rent_start_date" attrs="{'readonly': [('state','!=','draft')]}"/>
</group>
<field name="checklist_line">
<tree string="Fleet Checklist Lines" editable="bottom">
<field name="name"/>
<field name="checklist_active"/>
<field name="price"/>
</tree>
<form>
<sheet>
<group>
<field name="name"/>
<field name="checklist_active" invisible="1"/>
<field name="checklist_number" invisible="1"/>
</group>
</sheet>
</form>
</field>
<div>
<group class="oe_subtotal_footer oe_right">
<field name="total"/>
<field name="tools_missing_cost"/>
<field name="damage_cost_sub"/>
<field name="total_cost" class="oe_subtotal_footer_separator"/>
<group>
<field name="rent_end_date" attrs="{'readonly': [('state','=','done')]}"/>
<field name="cost" invisible="1"/>
</group>
</group>
</group>
<notebook>
<page string="Recurring Invoices">
<field name="recurring_line" mode="tree">
<tree string="Fleet Reccurring Lines"
colors="#0b7a35:payment_info=='paid';#f20b07:payment_info!='paid'">
<field name="date_today"/>
<field name="name"/>
<field name="account_info"/>
<field name="recurring_amount"/>
<field name="payment_info"/>
</tree>
</field>
</page>
<page string="Checklist">
<group>
<group>
<field name="attachment_ids" widget="many2many_binary" class="oe_inline"/>
</group>
<group>
<field name="damage_cost"
attrs="{'invisible': [('state','!=','checking')]}"/>
</group>
</group>
</div>
<div style="float: right;margin-left: 78%;margin-bottom: 36px;">
<button name="action_verify" string="Verify" type="object"
style="width: 100px !important;height: 40px;"
attrs="{'invisible': [('state', '!=', 'checking')]}"
class="oe_subtotal_footer oe_right oe_highlight"/>
</div>
</page>
</notebook>
<group>
<field name="notes"/>
</group>
<field name="checklist_line">
<tree string="Fleet Checklist Lines" editable="bottom">
<field name="name"/>
<field name="checklist_active"/>
<field name="price"/>
</tree>
<form>
<sheet>
<group>
<field name="name"/>
<field name="checklist_active" invisible="1"/>
<field name="checklist_number" invisible="1"/>
</group>
</sheet>
</form>
</field>
<div>
<group class="oe_subtotal_footer oe_right">
<field name="total"/>
<field name="tools_missing_cost"/>
<field name="damage_cost_sub"/>
<field name="total_cost" class="oe_subtotal_footer_separator"/>
</group>
</div>
<div style="float: right;margin-left: 78%;margin-bottom: 36px;">
<button name="action_verify" string="Verify" type="object"
style="width: 100px !important;height: 40px;"
attrs="{'invisible': [('state', '!=', 'checking')]}"
class="oe_subtotal_footer oe_right oe_highlight"/>
</div>
</page>
</notebook>
<group>
<field name="notes"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="car_contract_tree_view">
<field name="name">car_contract_tree_view.tree</field>
<field name="model">car.rental.contract</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="car_contract_result">
<field name="name" string="Renter"/>
<tree string="car_contract_result" decoration-info="state == 'draft'" colors="grey:state == 'done';
green:state == 'running';red:state == 'checking';black:state == 'invoice';">
<field name="name"/>
<field name="customer_id" string="Customer"/>
<field name="vehicle_id"/>
<field name="cost"/>
<field name="car_brand" />
@ -157,12 +188,17 @@
</tree>
</field>
</record>
<record id="action_car_rental_contract" model="ir.actions.act_window">
<field name="name">Rental Contract</field>
<field name="res_model">car.rental.contract</field>
<field name="view_type">form</field>
<field name="domain">[('sales_person','=', uid)]</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Fleet Rental" id="fleet.menu_root" sequence="115" groups="fleet.fleet_group_user"
web_icon="fleet,static/description/icon.png"/>
<menuitem id="menu_car_parent" sequence="1" name="Rental Management" parent="fleet.menu_root"/>
<menuitem id="menu_car_rental_contract" parent="menu_car_parent" name="Rental Contract"
action="action_car_rental_contract" sequence="1"/>

3
fleet_rental/views/car_tools_view.xml

@ -20,6 +20,7 @@
</form>
</field>
</record>
<record id="car_rental_contract_tools_tree_view" model="ir.ui.view">
<field name="name">car_rental_contract_tools_tree_view.tree</field>
<field name="model">car.tools</field>
@ -31,12 +32,14 @@
</tree>
</field>
</record>
<record id="action_fleet_car_tools" model="ir.actions.act_window">
<field name="name">Tools</field>
<field name="res_model">car.tools</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="menu_car_tools" parent="menu_car_parent" name="Tools"
action="action_fleet_car_tools" sequence="3"/>
</data>

12
fleet_rental/views/checklist_view.xml

@ -15,11 +15,11 @@
<sheet>
<group>
<group>
<field name="contract_name" string="Contract" readonly="1"/>
<field name="name" string="Contract" readonly="1"/>
<field name="attachment_ids" widget="many2many_binary" class="oe_inline" readonly="1"/>
</group>
<group>
<field name="damage_cost" readonly="1"/>
<field name="damage_cost"/>
</group>
</group>
<notebook>
@ -45,23 +45,26 @@
</form>
</field>
</record>
<record id="car_rental_contract_checklist_tree_view" model="ir.ui.view">
<field name="name">car_rental_contract_checklist_tree_view.tree</field>
<field name="model">car.rental.contract</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="car_contract_result2" create="false" colors="#f20b07:state=='checking'">
<field name="contract_name" string="Contract"/>
<tree string="car_contract_result2" create="false" colors="#f20b07:state=='checking';green:state=='running'" decoration-info="state == 'draft'">
<field name="name" string="Contract"/>
<field name="name" string="Renter"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_fleet_rent_checklist" model="ir.actions.act_window">
<field name="name">Checklist</field>
<field name="res_model">car.rental.contract</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state', 'in', ('running', 'checking')), ('sales_person','=', uid)]</field>
<field name="view_id" ref="car_rental_contract_checklist_form_view"/>
</record>
@ -78,6 +81,7 @@
<field name="view_id" ref="car_rental_contract_checklist_tree_view"/>
<field name="act_window_id" ref="action_fleet_rent_checklist"/>
</record>
<menuitem id="menu_car_checklist" parent="menu_car_parent" name="Checklist"
action="action_fleet_rent_checklist" sequence="2"/>
</data>

Loading…
Cancel
Save