Browse Source

Feb 23 : [ADD] Initial Commit 'odoo_rental_sales'

pull/254/merge
RisvanaCybro 1 year ago
parent
commit
bf9b07a733
  1. 51
      odoo_rental_sales/README.rst
  2. 23
      odoo_rental_sales/__init__.py
  3. 55
      odoo_rental_sales/__manifest__.py
  4. 16
      odoo_rental_sales/data/ir_cron_data.xml
  5. 21
      odoo_rental_sales/data/ir_sequence_data.xml
  6. 7
      odoo_rental_sales/doc/RELEASE_NOTES.md
  7. 27
      odoo_rental_sales/models/__init__.py
  8. 40
      odoo_rental_sales/models/product_product.py
  9. 93
      odoo_rental_sales/models/rental_order_contract.py
  10. 37
      odoo_rental_sales/models/rental_product_agreement.py
  11. 48
      odoo_rental_sales/models/rental_product_category.py
  12. 184
      odoo_rental_sales/models/sale_order.py
  13. 30
      odoo_rental_sales/models/uom_uom.py
  14. 5
      odoo_rental_sales/security/ir.model.access.csv
  15. 9
      odoo_rental_sales/security/odoo_rental_sales_security.xml
  16. BIN
      odoo_rental_sales/static/description/assets/icons/cogs.png
  17. BIN
      odoo_rental_sales/static/description/assets/icons/consultation.png
  18. BIN
      odoo_rental_sales/static/description/assets/icons/ecom-black.png
  19. BIN
      odoo_rental_sales/static/description/assets/icons/education-black.png
  20. BIN
      odoo_rental_sales/static/description/assets/icons/hotel-black.png
  21. BIN
      odoo_rental_sales/static/description/assets/icons/license.png
  22. BIN
      odoo_rental_sales/static/description/assets/icons/lifebuoy.png
  23. BIN
      odoo_rental_sales/static/description/assets/icons/logo.png
  24. BIN
      odoo_rental_sales/static/description/assets/icons/manufacturing-black.png
  25. BIN
      odoo_rental_sales/static/description/assets/icons/pos-black.png
  26. BIN
      odoo_rental_sales/static/description/assets/icons/puzzle.png
  27. BIN
      odoo_rental_sales/static/description/assets/icons/restaurant-black.png
  28. BIN
      odoo_rental_sales/static/description/assets/icons/service-black.png
  29. BIN
      odoo_rental_sales/static/description/assets/icons/trading-black.png
  30. BIN
      odoo_rental_sales/static/description/assets/icons/training.png
  31. BIN
      odoo_rental_sales/static/description/assets/icons/update.png
  32. BIN
      odoo_rental_sales/static/description/assets/icons/user.png
  33. BIN
      odoo_rental_sales/static/description/assets/icons/wrench.png
  34. BIN
      odoo_rental_sales/static/description/assets/misc/categories.png
  35. BIN
      odoo_rental_sales/static/description/assets/misc/check-box.png
  36. BIN
      odoo_rental_sales/static/description/assets/misc/compass.png
  37. BIN
      odoo_rental_sales/static/description/assets/misc/corporate.png
  38. BIN
      odoo_rental_sales/static/description/assets/misc/customer-support.png
  39. BIN
      odoo_rental_sales/static/description/assets/misc/cybrosys-logo.png
  40. BIN
      odoo_rental_sales/static/description/assets/misc/features.png
  41. BIN
      odoo_rental_sales/static/description/assets/misc/logo.png
  42. BIN
      odoo_rental_sales/static/description/assets/misc/pictures.png
  43. BIN
      odoo_rental_sales/static/description/assets/misc/pie-chart.png
  44. BIN
      odoo_rental_sales/static/description/assets/misc/right-arrow.png
  45. BIN
      odoo_rental_sales/static/description/assets/misc/star.png
  46. BIN
      odoo_rental_sales/static/description/assets/misc/support.png
  47. BIN
      odoo_rental_sales/static/description/assets/misc/whatsapp.png
  48. BIN
      odoo_rental_sales/static/description/assets/modules/1.png
  49. BIN
      odoo_rental_sales/static/description/assets/modules/2.png
  50. BIN
      odoo_rental_sales/static/description/assets/modules/3.png
  51. BIN
      odoo_rental_sales/static/description/assets/modules/4.png
  52. BIN
      odoo_rental_sales/static/description/assets/modules/5.png
  53. BIN
      odoo_rental_sales/static/description/assets/modules/6.png
  54. BIN
      odoo_rental_sales/static/description/assets/screenshots/hero.gif
  55. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent1.png
  56. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent10.png
  57. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent11.png
  58. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent2.png
  59. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent3.png
  60. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent4.png
  61. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent5.png
  62. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent6.png
  63. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent7.png
  64. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent8.png
  65. BIN
      odoo_rental_sales/static/description/assets/screenshots/rent9.png
  66. BIN
      odoo_rental_sales/static/description/banner.png
  67. BIN
      odoo_rental_sales/static/description/icon.png
  68. 751
      odoo_rental_sales/static/description/index.html
  69. 56
      odoo_rental_sales/views/product_views.xml
  70. 20
      odoo_rental_sales/views/rental_conf_menu_views.xml
  71. 19
      odoo_rental_sales/views/rental_menu_views.xml
  72. 69
      odoo_rental_sales/views/rental_order_contract_views.xml
  73. 36
      odoo_rental_sales/views/rental_product_agreement_views.xml
  74. 36
      odoo_rental_sales/views/rental_product_category_views.xml
  75. 115
      odoo_rental_sales/views/sale_order_views.xml
  76. 55
      odoo_rental_sales/views/uom_views.xml
  77. 22
      odoo_rental_sales/wizard/__init__.py
  78. 49
      odoo_rental_sales/wizard/rental_product.py
  79. 35
      odoo_rental_sales/wizard/rental_product_views.xml

51
odoo_rental_sales/README.rst

@ -0,0 +1,51 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Odoo Rental Sales
=================
* The Odoo Rental Sales module allows businesses to create and manage rental orders, track the availability of rental products, and execute rental contracts and invoices.
Installation
============
- www.odoo.com/documentation/15.0/setup/install.html
- Install our custom addon
Configuration
=============
- Additional configuration not required
License
-------
General Public License, Version 3 (AGPL-3).
(http://www.gnu.org/licenses/agpl-3.0-standalone.html)
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
Developer: (V15) - Aswathi PN, Contact: odoo@cybrosys.com
Contacts
--------
* Mail Contact : odoo@cybrosys.com
* Website : https://cybrosys.com
Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com
Further information
===================
HTML Description: `<static/description/index.html>`__

23
odoo_rental_sales/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import models
from . import wizard

55
odoo_rental_sales/__manifest__.py

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
{
'name': 'Odoo Rental Sales',
'version': '15.0.1.0.0',
'category': 'Sales',
'summary': "The module helps in rental management.",
'description': "This module allows businesses to create rental orders, "
"track the availability of rental products, and manage "
"rental contracts and invoices.",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://cybrosys.com',
'depends': ['product', 'sale_management'],
'data': [
'security/odoo_rental_sales_security.xml',
'security/ir.model.access.csv',
'data/ir_sequence_data.xml',
'data/ir_cron_data.xml',
'wizard/rental_product_views.xml',
'views/rental_order_contract_views.xml',
'views/product_views.xml',
'views/rental_product_category_views.xml',
'views/rental_product_agreement_views.xml',
'views/uom_views.xml',
'views/rental_menu_views.xml',
'views/sale_order_views.xml',
'views/rental_conf_menu_views.xml',
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': True,
}

16
odoo_rental_sales/data/ir_cron_data.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!--Schedule action for contract expiration-->
<record id="rental_scheduler_recurring_action" model="ir.cron">
<field name="name">Rental Scheduler Recurring Activity</field>
<field name="model_id" ref="model_rental_order_contract"/>
<field name="state">code</field>
<field name="code">model._contract_expiration()</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
</record>
</data>
</odoo>

21
odoo_rental_sales/data/ir_sequence_data.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!--Creating Sequence number for sale order line-->
<record id="seq_sale_order_line" model="ir.sequence">
<field name="name">Order Line Sequence</field>
<field name="code">sale.order.line</field>
<field name="prefix">RO</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
<!--Creating sequence number for rental order contract-->
<record id="seq_rental_contract" model="ir.sequence">
<field name="name">Rental Contract Sequence</field>
<field name="code">rental.order.contract</field>
<field name="prefix">ROC</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
</data>
</odoo>

7
odoo_rental_sales/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <odoo_rental_sales>
#### 25.01.2024
#### Version 15.0.1.0.0
#### ADD
- Initial commit for Odoo Rental Sales

27
odoo_rental_sales/models/__init__.py

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import product_product
from . import rental_order_contract
from . import rental_product_agreement
from . import rental_product_category
from . import sale_order
from . import uom_uom

40
odoo_rental_sales/models/product_product.py

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
class ProductProduct(models.Model):
"""Adding some new fields to the product model"""
_inherit = 'product.product'
rental = fields.Boolean(string='Rental',
help='To check the product is rental or not')
category_id = fields.Many2one('rental.product.category',
string='Rental Category',
help='To add rental product category')
security_amount = fields.Monetary(string='Security Amount',
help='To add the security amount of the '
'product')
product_agreement_id = fields.Many2one('rental.product.agreement',
string='Product Agreement',
help='To add the product agreement')

93
odoo_rental_sales/models/rental_order_contract.py

@ -0,0 +1,93 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class RentalOrderContract(models.Model):
"""Model for showing the rental order contracts"""
_name = "rental.order.contract"
_description = 'Rental Order Contract'
_rec_name = 'reference_no'
reference_no = fields.Char(string='Reference', copy=False,
readonly=True, default=lambda self: _('New'),
help='To store the reference number to the '
'rental contract')
partner_id = fields.Many2one('res.partner', string='Customer',
help='To add the customer of the rental order')
product_id = fields.Many2one('product.product', string='Rental Product',
help='To add the rental product')
qty = fields.Float(string='Quantity',
help='To add the rental product quantity')
currency_id = fields.Many2one('res.currency', string="Currency",
related='company_id.currency_id',
help='To add the company currency')
unit_price = fields.Monetary(string='Unit Price',
help='To add the unit price of the product')
date_start = fields.Datetime(string='Start Date',
help='Contract start date')
date_end = fields.Datetime(string='End Date', help='Contract end date')
sale_order_id = fields.Many2one('sale.order', string='Sale Order',
help='Sale of the contract')
rental_order_id = fields.Many2one('sale.order.line', string='Rental Order',
help='Rental order of the contract')
company_id = fields.Many2one('res.company', required=True,
default=lambda self: self.env.company,
help='Set the company')
contract_status = fields.Selection(
[('new', 'New'), ('confirmed', 'Confirmed'), ('expired', 'Expired'),
('cancel', 'Cancelled')],
default='new', string='Contract Status',
help='To show the contract status')
@api.onchange('date_start', 'date_end')
def _onchange_date_start(self):
"""Checking whether the end date is less than or equal to the start date"""
if self.date_start and self.date_end and self.date_start > self.date_end:
raise UserError(
_('The end date must be after or the same as the start date'))
def _contract_expiration(self):
"""Calculating the expiration date of the contract"""
rental_contract = self.env['rental.order.contract'].search(
[('contract_status', 'not in', ['expired', 'cancel'])])
for rec in rental_contract:
if rec.date_end:
if rec.date_end.date() < fields.date.today():
rec.contract_status = 'expired'
def action_confirm_contract(self):
""" Function for contract confirmation"""
self.contract_status = 'confirmed'
def action_cancel_contract(self):
""" Function for cancel contract"""
self.contract_status = 'cancel'
@api.model
def create(self, vals):
"""Creating sequence for the rental contract"""
if vals.get('reference_no', _('New')) == _('New'):
vals['reference_no'] = self.env['ir.sequence'].next_by_code(
'rental.order.contract') or _('New')
return super(RentalOrderContract, self).create(vals)

37
odoo_rental_sales/models/rental_product_agreement.py

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
class RentalProductAgreement(models.Model):
"""Model for showing the rental agreement details"""
_name = 'rental.product.agreement'
_description = 'Rental Product Agreement'
name = fields.Char(string='Name', required=True,
help='Name of rental product agreement')
sequence = fields.Integer(string='Sequence', required=True,
help='Sequence of rental product Agreement')
description = fields.Text(string='Description',
help='Description of rental product agreement')
agreement_file = fields.Binary(string='Product Agreement',
help='Rental product agreement file')

48
odoo_rental_sales/models/rental_product_category.py

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
class RentalProductCategory(models.Model):
"""Model for configuring the rental product category"""
_name = 'rental.product.category'
_description = 'Rental Product Categories'
name = fields.Char(string='Name', required=True,
help='Name of rental product category')
def action_view_rental_products(self):
"""Showing the products under the rental category
:param :
:return: tree view that under the rental category
"""
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': 'Rental Products',
'view_mode': 'tree',
'res_model': 'product.product',
'domain': [('category_id', '=', self.id)],
'context': "{'create': False}"
}

184
odoo_rental_sales/models/sale_order.py

@ -0,0 +1,184 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class SaleOrder(models.Model):
"""Inherit the sale order to add new features"""
_inherit = 'sale.order'
rental_status = fields.Selection(
[('new', 'New'), ('confirmed', 'Confirmed'),
('cancel', 'Cancelled')],
default='new', string='Rental Status',
help='To showing the rental status of the order')
def action_confirm(self):
"""For creating rental order contract at the time of confirm the sale order"""
res = super(SaleOrder, self).action_confirm()
for product in self.order_line:
if product.rental:
product.is_rental = True
self.env['rental.order.contract'].create([{
'partner_id': self.partner_id.id,
'product_id': product.product_id.id,
'qty': product.product_uom_qty,
'unit_price': product.price_unit,
'rental_order_id': product.id,
'sale_order_id': self.id,
}])
return res
class SaleOrderLine(models.Model):
"""Inherit sale order line to add contract details on the sale order line form view"""
_inherit = 'sale.order.line'
_rec_name = 'reference_no'
reference_no = fields.Char(string='Reference', copy=False,
readonly=True, default=lambda self: _('New'),
help='Showing the reference number of sale '
'order line')
initial_contract_id = fields.Many2one('rental.order.contract',
string='Initial Contract',
help='To add initial contract')
initial_start = fields.Datetime(string='Start Date',
help='Initial start date of Rental Order '
'Contract',
related='initial_contract_id.date_start')
initial_end = fields.Datetime(string='End Date',
help='Initial end date of Rental Order '
'Contract',
related='initial_contract_id.date_end')
initial_qty = fields.Float(string='Quantity',
help='Quantity of initial contract',
related='initial_contract_id.qty')
current_contract_id = fields.Many2one('rental.order.contract',
string='Current Contract',
help='To add the current contract')
partner_id = fields.Many2one('res.partner', string='Partner',
help='Partner of the corresponding sale order')
current_start = fields.Datetime(string='Start Date',
help='Current contract start date',
related='current_contract_id.date_start')
current_end = fields.Datetime(string='End Date',
help='Current contract end date',
related='current_contract_id.date_end')
current_qty = fields.Float(string='Quantity',
help='Current contract product quantity',
related='current_contract_id.qty')
last_renewal_time = fields.Datetime(string='Last Renewal Time',
help='Last Date contract Renewal')
is_rental = fields.Boolean(string='Is Rental',
help='To check the order is rental or not')
rental = fields.Boolean(string='Rental', related='product_id.rental',
help='To check the order line product is rental '
'or not')
current_contract_values = fields.Boolean(string='Initial',
compute='_compute_current_contract_values',
help='To Update the values')
rental_status = fields.Selection(
[('new', 'New'), ('confirmed', 'Confirmed'),
('cancel', 'Cancelled')],
default='new', string='Rental Status',
help='To showing the rental status of the order')
rental_contract_ids = fields.One2many('rental.order.contract',
'rental_order_id',
string='Rental Contract',
help='To showing the rental order '
'contract')
def _compute_current_contract_values(self):
"""For fetching the current contract values to the sale order line
form view"""
for rec in self:
rec.current_contract_values = False
try:
recs_sorted = \
rec.rental_contract_ids.sorted(key=lambda r: r.date_start)[
0] if rec.rental_contract_ids.sorted(
key=lambda r: r.date_start) else False
rec.current_contract_values = True
for record in rec.rental_contract_ids:
if record.date_start and record.date_end:
if record.date_start.date() <= fields.date.today() <= record.date_end.date():
rec.current_contract_id = record.id
rec.last_renewal_time = record.date_end
if recs_sorted:
rec.initial_contract_id = recs_sorted.id
except:
continue
@api.onchange('initial_start', 'initial_end', 'current_start',
'current_end')
def _onchange_initial_start(self):
"""Checking whether the end date is less than or equal to the start date"""
if self.initial_start and self.initial_end and self.initial_start > self.initial_end:
raise UserError(
_('The end date must be after or the same as the start date'))
if self.current_start and self.current_end and self.current_start > self.current_end:
raise UserError(
_('The end date must be after or the same as the start date'))
@api.model
def create(self, vals):
"""For adding references number to sale order line"""
if vals.get('reference_no', _('New')) == _('New'):
vals['reference_no'] = self.env['ir.sequence'].next_by_code(
'sale.order.line') or _('New')
return super(SaleOrderLine, self).create(vals)
def action_confirm(self):
""" Function for confirm the order line"""
self.rental_status = 'confirmed'
def action_cancel(self):
""" Function for cancel sale order """
self.rental_status = 'cancel'
def action_renew_contract(self):
"""For renewing the rental order
:param :
:return: rental order renewing form view
"""
self.ensure_one()
vals = []
for rec in self.rental_contract_ids[
0] if self.rental_contract_ids else '':
vals.append({
'partner_id': rec.partner_id.id,
'product_id': rec.product_id.id,
'rental_order_id': rec.rental_order_id.id,
'sale_order_id': rec.sale_order_id.id,
'qty': rec.qty,
'unit_price': rec.unit_price,
})
contract_rec = self.env['rental.order.contract'].create(vals)
return {
'name': _('Renew Rental Order'),
'view_mode': 'form',
'res_model': 'rental.order.contract',
'type': 'ir.actions.act_window',
'target': 'new',
'res_id': contract_rec.id,
}

30
odoo_rental_sales/models/uom_uom.py

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
class UomUom(models.Model):
"""Inherit uom model to add new field"""
_inherit = 'uom.uom'
is_rental = fields.Boolean(string='Rental',
help='Check the uom is for rental or not')

5
odoo_rental_sales/security/ir.model.access.csv

@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_rental_product_agreement_user,access.rental.product.agreement.user,model_rental_product_agreement,base.group_user,1,1,1,1
access_rental_product_category_user,access.rental.product.category.user,model_rental_product_category,base.group_user,1,1,1,1
access_rental_product_user,access.rental.product.user,model_rental_product,base.group_user,1,1,1,1
access_rental_order_contract_user,access.rental.order.contract.user,model_rental_order_contract,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_rental_product_agreement_user access.rental.product.agreement.user model_rental_product_agreement base.group_user 1 1 1 1
3 access_rental_product_category_user access.rental.product.category.user model_rental_product_category base.group_user 1 1 1 1
4 access_rental_product_user access.rental.product.user model_rental_product base.group_user 1 1 1 1
5 access_rental_order_contract_user access.rental.order.contract.user model_rental_order_contract base.group_user 1 1 1 1

9
odoo_rental_sales/security/odoo_rental_sales_security.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Multi company record rule-->
<record id="rental_order_contract_rule_company" model="ir.rule">
<field name="name">Rental Order Contract Rule</field>
<field name="model_id" ref="model_rental_order_contract"/>
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
</odoo>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
odoo_rental_sales/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
odoo_rental_sales/static/description/assets/modules/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
odoo_rental_sales/static/description/assets/modules/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
odoo_rental_sales/static/description/assets/modules/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
odoo_rental_sales/static/description/assets/modules/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
odoo_rental_sales/static/description/assets/modules/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
odoo_rental_sales/static/description/assets/screenshots/rent9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
odoo_rental_sales/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
odoo_rental_sales/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

751
odoo_rental_sales/static/description/index.html

@ -0,0 +1,751 @@
<div style="background-color: #714B67; min-height: 600px; width: 100%; padding: 15px; position: relative;">
<!-- TITLE BAR -->
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="./assets/misc/cybrosys-logo.png" width="42" height="42"
style="width: 42px; height: 42px;"/>
<div>
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Community
</div>
</div>
</div>
<!-- END OF TITLE BAR -->
<!-- APP HERO -->
<div class="container" style="padding: 0rem 1.5rem 4rem !important">
<div class="row" style="height: 900px !important;">
<div class="col-sm-12 col-md-12 col-lg-12"
style="padding: 4rem 1rem !important; background-color: #714B67 !important; height: 600px !important; border-radius: 20px !important;">
<h1 style="color: #FFFFFF; font-weight: bolder; font-size: 50px; text-align: center; margin-top: 50px;">
Odoo Rental Sales</h1>
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;">Helps to Manage the
Rental
Orders.</p>
<!-- END OF APP HERO -->
<img src="./assets/screenshots/hero.gif"
style="width: 75%; height: auto; position: absolute; margin-left: auto; margin-right: auto; top: 45%; left: 12%; right: auto;"/>
</div>
</div>
</div>
</div>
<!-- NAVIGATION SECTION -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/compass.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Explore This
Module</h2>
</div>
<div class="row my-4" style="font-family: 'Montserrat', sans-serif;">
<div class="col-sm-12 col-md-6 my-3">
<a href="#overview">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Overview</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">Learn
more about this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#features">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Features</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
features of this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#screenshots">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Screenshots</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
screenshots for this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
</div>
<!-- END OF NAVIGATION SECTION -->
<!-- OVERVIEW SECTION -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pie-chart.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Overview
</h2>
</div>
<div class="row"
style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 py-4">
The community version of Odoo currently doesn't provide a rental management system.
By using this module, you can effortlessly handle rental sales.
</div>
</div>
<!-- END OF OVERVIEW SECTION -->
<!-- FEATURES SECTION -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/features.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Features
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Available in Odoo 15.0 Community</span>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">User Can Manage The Rental Orders By Using This Module.</span>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Manage the Rental Contract and renew Contract.</span>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Creating Rental Category, Rental Products, Unit of Measures.</span>
</div>
</div>
</div>
<!-- END OF FEATURES SECTION -->
<!-- SCREENSHOTS SECTION -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;"
id="screenshots">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pictures.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Screenshots
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Sale
order under
Rental menu.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">In the Rental Sales menu, users have access to all existing
Sale Orders and can also create new Sale Orders directly from there.</p>
<img src="./assets/screenshots/rent1.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Add
Rental
products.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">On the Sale Order form
there is a button labeled 'ADD RENTAL PRODUCT'. By clicking on that button
we can add a Rental Product on
that sale order line.</p>
<img src="./assets/screenshots/rent2.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Order.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"> From the Rental Order menu, we can see all Rental Orders.</p>
<img src="./assets/screenshots/rent3.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Order
Details.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">By selecting any
Rental Order we can see complete details of that Rental Order.</p>
<img src="./assets/screenshots/rent4.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Renew
Expired
Rental
Contract.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">We can renew an
expired Rental Order by clicking the 'RENEW CONTRACT' button and a new pop-up will appear.</p>
<img src="./assets/screenshots/rent5.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Contract.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Here you
can see
all
rental order contracts</p>
<img src="./assets/screenshots/rent6.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Contract
Details.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Here we can see
the complete details of the Rental Contract.</p>
<img src="./assets/screenshots/rent7.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Products.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/rent8.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Product
Details.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">We can choose whether the product is available for Rental or not.
Also, able to add Product Agreement, Security Amount and
Rental Category for
that product.</p>
<img src="./assets/screenshots/rent9.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Category.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">From the Rental Category menu, we can create new Rental Product Categories.</p>
<img src="./assets/screenshots/rent10.png" class="img-thumbnail">
</div>
</div>
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Rental
Agreement.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">From the Rental Agreement menu, we can create new Rental Product Agreements.</p>
<img src="./assets/screenshots/rent11.png" class="img-thumbnail">
</div>
</div>
</div>
<!-- END OF SCREENSHOTS SECTION -->
<!-- RELATED PRODUCTS -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="./assets/misc/categories.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Related
Products
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner" style="padding: 30px;">
<div class="carousel-item" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/laundry_management/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/user_login_alert/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/dynamic_accounts_report/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item active"
style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/dashboard_pos/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/pos_delete_orderline/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/pos_restrict/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/6.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="width:35px; color:#000"> <span
class="carousel-control-prev-icon"><i
class="fa fa-chevron-left"
style="font-size:24px"></i></span>
</a> <a class="carousel-control-next" href="#demo1"
data-slide="next" style="width:35px; color:#000">
<span class="carousel-control-next-icon"><i
class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF RELATED PRODUCTS -->
<!-- OUR SERVICES -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="./assets/misc/star.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Our Services
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</div>
<!-- END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="./assets/misc/corporate.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Our
Industries
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</div>
<!-- END OF OUR INDUSTRIES -->
<!-- SUPPORT -->
<div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="./assets/misc/customer-support.png"/>
</div>
<h2 class="mt-2"
style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Support
</h2>
</div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="./assets/misc/support.png" height="48" width="48"
style="width: 42px; height: 42px;"/>
</div>
<div>
<h4>Need Help?</h4>
<p style="line-height: 100%;">Got questions or need help?
Get in touch.</p>
<a href="mailto:odoo@cybrosys.com">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
odoo@cybrosys.com</p>
</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="./assets/misc/whatsapp.png" height="52" width="52"
style="width: 52px; height: 52px;"/>
</div>
<div>
<h4>WhatsApp</h4>
<p style="line-height: 100%;">Say hi to us on WhatsApp!</p>
<a href="https://api.whatsapp.com/send?phone=918606827707">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
+91 86068
27707</p>
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="./assets/misc/logo.png" width="144" height="31"
style="width:144px; height: 31px; margin-top: 40px;"/>
</div>
</div>
</div>
<!-- END OF SUPPORT -->

56
odoo_rental_sales/views/product_views.xml

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Add a filter to the product form view-->
<record id="product_product_view_search" model="ir.ui.view">
<field name="name">product.product.view.search.inherit.odoo.rental.sales</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<search>
<filter string="Rental" name="rental"
domain="[('rental', '=',True)]"/>
</search>
</field>
</record>
<!--Inherited product action for passing new context-->
<record id="product_product_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="context">{'search_default_rental': 1, "default_rental": True}</field>
<field name="view_id" ref="product.product_search_form_view"/>
<field name="search_view_id" ref="odoo_rental_sales.product_product_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new rental product
</p>
</field>
</record>
<!--Adding custom field to the product form view-->
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.product.view.form.inherit.odoo.rental.sales</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='options']" position="inside">
<span class="d-inline-block">
<field name="rental"/>
<label for="rental"/>
</span>
</xpath>
<xpath expr="//notebook[last()]" position="inside">
<page string="Rental" name="rental">
<group>
<group>
<field name="category_id"/>
<field name="security_amount"/>
</group>
<group>
<field name="product_agreement_id"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

20
odoo_rental_sales/views/rental_conf_menu_views.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Menu items under configuration menu-->
<menuitem id="rental_conf_settings_menu"
name="Settings"
action="sale.action_sale_config_settings"
parent="odoo_rental_sales.rental_configuration_menu"/>
<menuitem id="rental_conf_category_menu"
name="Rental Category"
action="rental_product_category_action"
parent="odoo_rental_sales.rental_configuration_menu"/>
<menuitem id="rental_conf_agreement_menu"
name="Rental Agreement"
action="rental_product_agreement_action"
parent="odoo_rental_sales.rental_configuration_menu"/>
<menuitem id="rental_conf_uom_menu"
name="Rental UOM"
parent="odoo_rental_sales.rental_configuration_menu"
action="uom_uom_search_view"/>
</odoo>

19
odoo_rental_sales/views/rental_menu_views.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Main menus on the rental module-->
<menuitem id="rental_menu_root"
name="Rental" web_icon="odoo_rental_sales,static/description/icon.png"/>
<menuitem id="rental_sales_menu"
name="Rental Sales"
parent="rental_menu_root"
sequence="1"/>
<menuitem id="rental_products_menu"
name="Products"
parent="rental_menu_root"
sequence="2"
action="product_product_action"/>
<menuitem id="rental_configuration_menu"
name="Configuration"
parent="rental_menu_root"
sequence="3"/>
</odoo>

69
odoo_rental_sales/views/rental_order_contract_views.xml

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Rental order contract tree view-->
<record id="rental_order_contract_view_tree" model="ir.ui.view">
<field name="name">rental.order.contract.view.tree</field>
<field name="model">rental.order.contract</field>
<field name="arch" type="xml">
<tree>
<field name="reference_no"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="company_id" invisible="1"/>
<field name="qty"/>
<field name="unit_price"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="rental_order_id"/>
<field name="sale_order_id"/>
<field name="contract_status"/>
</tree>
</field>
</record>
<!--Rental order contract form view-->
<record id="rental_order_contract_view_form" model="ir.ui.view">
<field name="name">rental.order.contract.view.form</field>
<field name="model">rental.order.contract</field>
<field name="arch" type="xml">
<form>
<header>
<button string="Confirm" name="action_confirm_contract"
class="oe_highlight"
type="object"
attrs="{'invisible':[('contract_status','!=','new')]}"/>
<button string="Cancel" name="action_cancel_contract"
class="btn-primary"
type="object"
attrs="{'invisible':[('contract_status','=','cancel')]}"/>
<field name="contract_status" widget="statusbar"
nolabel="1"/>
</header>
<sheet>
<field name="reference_no"/>
<group>
<group>
<field name="partner_id"/>
<field name="product_id"/>
<field name="company_id"/>
<field name="qty"/>
<field name="unit_price"/>
</group>
<group>
<field name="date_start"/>
<field name="date_end"/>
<field name="rental_order_id"/>
<field name="sale_order_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!--Rental order contract action-->
<record id="rental_order_contract_action" model="ir.actions.act_window">
<field name="name">Rental Contract</field>
<field name="res_model">rental.order.contract</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

36
odoo_rental_sales/views/rental_product_agreement_views.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Rental product agreement form view-->
<record id="rental_product_agreement_view_form" model="ir.ui.view">
<field name="name">rental.product.agreement.view.form</field>
<field name="model">rental.product.agreement</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="agreement_file"/>
</group>
<group>
<field name="sequence"/>
</group>
<label for="description"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>
<!--Rental product agreement action-->
<record id='rental_product_agreement_action' model='ir.actions.act_window'>
<field name="name">Rental Product Agreement</field>
<field name="res_model">rental.product.agreement</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new rental agreement
</p>
</field>
</record>
</odoo>

36
odoo_rental_sales/views/rental_product_category_views.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Rental product category form view-->
<record id="rental_product_category_view_form" model="ir.ui.view">
<field name="name">rental.product.category.view.form</field>
<field name="model">rental.product.category</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" string="Products"
name="action_view_rental_products" icon="fa-th-list"
type="object"/>
</div>
<group>
<group>
<field name="name"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!--Rental product category action-->
<record id='rental_product_category_action'
model='ir.actions.act_window'>
<field name="name">Rental Product Category</field>
<field name="res_model">rental.product.category</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new rental product category
</p>
</field>
</record>
</odoo>

115
odoo_rental_sales/views/sale_order_views.xml

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Inherit sale order to add a button-->
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.view.form.inherit.odoo.rental.sales</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='order_lines']//field[@name='order_line']"
position="before">
<button name="%(rental_product_action)d" type="action"
class="btn-primary" string="Add Rental Product"/>
</xpath>
</field>
</record>
<!--Inherit sale order tree view for add a field-->
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.view.tree.inherit.odoo.rental.sales</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_status']" position="after">
<field name="rental_status"/>
</xpath>
</field>
</record>
<!--Inherit sale order line tree view for add a field-->
<record id="view_order_line_tree" model="ir.ui.view">
<field name="name">sale.order.line.view.tree.inherit.odoo.rental.sales</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='price_subtotal']" position="after">
<field name="rental_status"/>
</xpath>
</field>
</record>
<!--Inherit Sale order line form view for adding buttons and fields-->
<record id="sale_order_line_view_form_readonly" model="ir.ui.view">
<field name="name">sale.order.line.view.form.inherit.odoo.rental.sales</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.sale_order_line_view_form_readonly"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position='before'>
<header>
<button string="Confirm" name="action_confirm"
class="oe_highlight"
type="object"
attrs="{'invisible':[('rental_status','!=','new')]}"/>
<button string="Cancel" name="action_cancel"
class="btn-primary"
type="object"
attrs="{'invisible':[('rental_status','=','cancel')]}"/>
<button string="Renew Contract" class="oe_highlight"
name="action_renew_contract" type="object"
attrs="{'invisible':[('rental_status','=','cancel')]}"/>
<field name="rental_status" widget="statusbar" nolabel="1"/>
</header>
</xpath>
<xpath expr="//group" position="inside">
<group string="Current Contract" name="current_contract"
attrs="{'invisible':[('rental_status','=','new')]}">
<field name="current_start"/>
<field name="current_end"/>
<field name="current_qty"/>
<field name="current_contract_id"/>
<field name="last_renewal_time"/>
</group>
<group string="Initial Contract" name="initial_contract"
attrs="{'invisible':[('rental_status','=','new')]}">
<field name="initial_start"/>
<field name="initial_end"/>
<field name="initial_qty"/>
<field name="initial_contract_id"/>
<field name="current_contract_values" invisible="1"/>
</group>
</xpath>
<xpath expr="//sheet" position='inside'>
<notebook>
<page string="Rental Contract">
<field name="rental_contract_ids">
<tree>
<field name="reference_no"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="contract_status"/>
</tree>
</field>
</page>
</notebook>
</xpath>
</field>
</record>
<!-- Inherited sale order tree view for add new domain-->
<record id="sale_order_line_action" model="ir.actions.act_window">
<field name="name">Rental Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('rental','=',True)]</field>
</record>
<!--Menu items under the rental order menu-->
<menuitem id="rental_sale_order_menu"
name="Sales Order"
action="sale.action_orders"
parent="odoo_rental_sales.rental_sales_menu"/>
<menuitem id="rental_order_menu"
name="Rental Order"
parent="odoo_rental_sales.rental_sales_menu"
action="sale_order_line_action"/>
<menuitem id="rental_contract_menu"
name="Rental Contract"
parent="odoo_rental_sales.rental_sales_menu"
action="rental_order_contract_action"/>
</odoo>

55
odoo_rental_sales/views/uom_views.xml

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--UOM filter view-->
<record id="uom_uom_view_search" model="ir.ui.view">
<field name="name">uom.uom.view.search.inherit.odoo.rental.sales</field>
<field name="model">uom.uom</field>
<field name="arch" type="xml">
<search>
<filter string="Rental" name="rental"
domain="[('is_rental', '=',True)]"/>
</search>
</field>
</record>
<!--Inherited uom search view-->
<record id="uom_uom_search_view" model="ir.actions.act_window">
<field name="name">Unit of Measure</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">uom.uom</field>
<field name="view_mode">tree,form,activity</field>
<field name="context">{'search_default_rental': 1}</field>
<field name="view_id" ref="uom.uom_uom_view_search"/>
<field name="search_view_id"
ref="odoo_rental_sales.uom_uom_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new rental product
</p>
</field>
</record>
<!--UOM form view-->
<record id="product_uom_form_view" model="ir.ui.view">
<field name="name">uom.uom.form.view.inherit.odoo.rental.sales</field>
<field name="model">uom.uom</field>
<field name="inherit_id" ref="uom.product_uom_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='rounding']" position="after">
<field name="is_rental"/>
</xpath>
<xpath expr="//field[@name='uom_type']" position="attributes">
<attribute name="readonly">0</attribute>
</xpath>
</field>
</record>
<!--UOM Tree view-->
<record id="product_uom_tree_view" model="ir.ui.view">
<field name="name">uom.uom.view.tree.inherit.odoo.rental.sales</field>
<field name="model">uom.uom</field>
<field name="inherit_id" ref="uom.product_uom_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='uom_type']" position="after">
<field name="is_rental"/>
</xpath>
</field>
</record>
</odoo>

22
odoo_rental_sales/wizard/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import rental_product

49
odoo_rental_sales/wizard/rental_product.py

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
class RentalProduct(models.TransientModel):
"""Creating a wizard that showing the rental product details"""
_name = 'rental.product'
_description = 'Rental Product'
rental_product_id = fields.Many2one('product.product',
domain=[('rental', '=', True)],
string='Rental Product',
help='To choose a rental product')
unit_price = fields.Float(string='Unit Price',
related='rental_product_id.lst_price',
help='Field for adding the unit price of the '
'product')
qty = fields.Float(string='Quantity',
help="Adding the required quantity of the product",
default=1)
def add_rental_product(self):
"""Function for adding the rental product to the sale order line"""
sale = self.env['sale.order'].browse(self.env.context.get('active_id'))
self.env['sale.order.line'].create({
'product_id': self.rental_product_id.id,
'order_id': sale.id,
'product_uom_qty': self.qty, })

35
odoo_rental_sales/wizard/rental_product_views.xml

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Rental product wizard form view-->
<record id="rental_product_view_form" model="ir.ui.view">
<field name="name">rental.product.view.form</field>
<field name="model">rental.product</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="rental_product_id"
context="{'default_rental': True}"/>
<field name="unit_price"/>
<field name="qty"/>
</group>
</group>
<footer>
<button special="cancel" string="Cancel"
class="btn-primary"/>
<button name="add_rental_product" string="Add Product"
type="object" class="btn-primary"/>
</footer>
</sheet>
</form>
</field>
</record>
<!--Rental product wizard action-->
<record id="rental_product_action" model="ir.actions.act_window">
<field name="name">Add Rental Product</field>
<field name="res_model">rental.product</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>
Loading…
Cancel
Save