Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4722871
Port sale_start_end_dates and sale_rental (#353)
Nov 8, 2016
df11d05
sale_start_end_dates and sale_rental
dvdhinesh Nov 15, 2016
b87d194
Product qty on rental pickings
alexis-via May 11, 2017
d859306
Auto configure sale_rental module via post_install.py script
alexis-via May 24, 2017
01824af
sale_rental: fix warning @constrains parameter 'must_have_dates' is n…
alexis-via Apr 4, 2018
ff1ab18
pylint
rousseldenis Sep 4, 2018
e778af1
sale_rental: Migration to 11.0
Mar 29, 2019
62049c2
[MIG] sale_start_end_dates and sale_rental to v12
alexis-via Jul 14, 2019
d08bf58
sale_rental: Improve the code of object sale.rental
alexis-via Jul 16, 2019
e379299
[IMP] enhancements suggested in code reviews
gurneyalex Oct 15, 2019
335e2bd
[FIX] Archive rental routes rather than delete
sadamo Oct 15, 2019
5844e5d
[UPD] Update sale_rental.pot
oca-travis Sep 16, 2020
d87c6dc
[UPD] README.rst
OCA-git-bot Sep 16, 2020
49d82b5
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Oct 1, 2020
a0ad507
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Oct 2, 2020
3ad7405
Update translation files
oca-transbot Oct 9, 2020
b36f4ae
Update translation files
oca-transbot Nov 22, 2020
ab3be3f
Translated using Weblate (Portuguese)
pedrocs-exo Feb 8, 2021
3c35122
[IMP] sale_rental: extract function _run_rental_procurement
yweng8111 Mar 5, 2021
5dd2c04
[UPD] Update sale_rental.pot
oca-travis Mar 12, 2021
8d93412
sale_rental 12.0.1.1.0
OCA-git-bot Mar 12, 2021
a5f5a80
Update translation files
oca-transbot Mar 12, 2021
3542b2a
[UPD] Update sale_rental.pot
oca-travis Mar 12, 2021
e2f6db5
Update translation files
oca-transbot Mar 12, 2021
eb60fac
[MIG] sale_rental from v12 to v14
alexis-via Jul 31, 2021
3527fa6
sale_rental: black, isort, etc.
alexis-via Jul 31, 2021
0999d24
[UPD] Update sale_rental.pot
oca-travis Dec 7, 2021
a8f9195
[UPD] README.rst
OCA-git-bot Dec 7, 2021
345723d
[MIG] sale_rental: Migration to 15.0
kirca Jan 17, 2022
b2a7fa3
[IMP] : black, isort, prettier, pylint
kirca Jan 17, 2022
feca503
[UPD] Update sale_rental.pot
May 17, 2022
1f8372f
[UPD] README.rst
OCA-git-bot May 17, 2022
82b66be
sale_rental 15.0.1.0.1
OCA-git-bot May 17, 2022
c625067
[UPD] README.rst
OCA-git-bot Jun 2, 2022
f95f15f
[UPD] README.rst
OCA-git-bot Jun 2, 2022
e467f63
Translated using Weblate (French (France))
gregory-moka Jun 3, 2022
e179e7b
Translated using Weblate (French (France))
gregory-moka Jun 3, 2022
fca00c4
Translated using Weblate (French)
gregory-moka Jul 4, 2022
f59e19d
[16.0][MIG] sale_rental
Murtaza-OSI Jan 3, 2023
c28f927
[IMP] sale_rental: black, isort, prettier
Mar 7, 2024
d2dbd86
[FIX] rework unit test
Mar 14, 2024
da469ad
[IMP] sale_rental: black, isort, prettier
Mar 14, 2024
87611e6
[UPD] Update sale_rental.pot
Apr 1, 2025
e505213
[BOT] post-merge updates
OCA-git-bot Apr 1, 2025
5196059
Translated using Weblate (Italian)
mymage Apr 1, 2025
f13265c
Translated using Weblate (Italian)
francesco-ooops Apr 1, 2025
0747796
Translated using Weblate (Italian)
mymage Apr 8, 2025
9c3fb9e
[FIX] sale_rental: fix create a duplicate sale.rental when reconfirming
chaule97 Sep 16, 2025
1488dbe
[IMP] sale_rental: Notification of rental expiration and scheduled re…
chaule97 Sep 18, 2025
be92c4b
[IMP] sale_rental: Price list in different unit of measures
chaule97 Sep 22, 2025
ae6f79b
[IMP] sale_rental: Add new calendar view
chaule97 Oct 1, 2025
2e499b9
[IMP] sale_rental: Add new graph view
chaule97 Oct 1, 2025
ab9809d
[IMP] sale_rental: Rental utilization report
chaule97 Oct 6, 2025
4264d78
[IMP] sale_rental: pre-commit auto fixes
edescalona May 15, 2025
a719fd4
[MIG] sale_rental: Migration to 17.0
edescalona May 15, 2025
5934b72
[IMP] sale_rental: pre-commit auto fixes
chaule97 Nov 13, 2025
6caac05
[IMP] sale_rental: pre-commit auto fixes
chaule97 Nov 13, 2025
a7142d2
[MIG] sale_rental: Migration to 18.0
chaule97 Nov 6, 2025
7f924f8
[Don't Merge] Add test-requirements.txt
chaule97 Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions sale_rental/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
===========
Sale Rental
===========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ba2abe11bd525be0990d3cbdf39dda8661bafb160f55e7c2474c2988d782055c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fvertical--rental-lightgray.png?logo=github
:target: https://github.com/OCA/vertical-rental/tree/18.0/sale_rental
:alt: OCA/vertical-rental
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/vertical-rental-18-0/vertical-rental-18-0-sale_rental
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/vertical-rental&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

With this module, you can rent products with Odoo. This module supports:

- regular rentals.
- rental extensions.
- sale of rented products.

**Table of contents**

.. contents::
:local:

Configuration
=============

In the *Products* menu, on the form view of a stockable product or
consumable, in the *Sales* tab, there is a button *Create Rental
Service* which starts a wizard to generate the corresponding rental
service.

In the menu *Inventory > Configuration > Warehouse Management >
Warehouses*, on the form view of the warehouse, in the *Technical
Information* tab, you will see two additional stock locations: *Rental
In* (stock of products to rent) and *Rental Out* (products currently
rented). In the *Warehouse Configuration* tab, make sure that the option
*Rental Allowed* is checked.

Usage
=====

In a sale order line (form view, not tree view), if you select a rental
service, you can:

- create a new rental with a start date and an end date: when the sale
order is confirmed, it will generate a delivery order and an incoming
shipment.
- extend an existing rental: the incoming shipment will be postponed to
the end date of the extension.

In a sale order line, if you select a product that has a corresponding
rental service, you can decide to sell the rented product that the
customer already has. If the sale order is confirmed, the incoming
shipment will be cancelled and a new delivery order will be created with
a stock move from *Rental Out* to *Customers*.

You can configure Rental Periods under Sales ▸ Configuration ▸ Rental
Period. A rental period defines the unit of time (Hour, Day, Week,
Month, …) with its conversion into hours. These periods are used to
compute rental duration.

You can configure Rental Pricing under Sales ▸ Products ▸ Rental
Pricing. For each rental service product, you define a price per rental
period. When you create a rental order line, the system selects the
period, computes the duration from the dates, and applies the
corresponding rental price. If a product has no price defined for the
selected period, the system will warn the user.

Known issues / Roadmap
======================

This module has the following limitations:

- No support for planning/agenda of the rented products (i.e. you can't
rely on this module to check your capacity to rent a product for the
selected dates when you create a quote)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/vertical-rental/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/vertical-rental/issues/new?body=module:%20sale_rental%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion
* Sodexis

Contributors
------------

- Alexis de Lattre <alexis.delattre@akretion.com>
- Sodexis <dev@sodexis.com>
- Danh Vo <https://github.com/danhvophuong>
- Kiril Vangelovski <kiril@lambda-is.com>
- Chau Le <chaulb@trobz.com>
- Hannes Hegewald <h.hegewald@humanilog.org>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/vertical-rental <https://github.com/OCA/vertical-rental/tree/18.0/sale_rental>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_rental/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
36 changes: 36 additions & 0 deletions sale_rental/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2014-2021 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright 2016-2021 Sodexis (http://sodexis.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Rental",
"version": "18.0.1.0.0",
"category": "Sales",
"license": "AGPL-3",
"summary": "Manage Rental of Products",
"author": "Akretion, Sodexis, Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/vertical-rental",
"depends": ["sale_start_end_dates", "sale_stock", "sales_team"],
"data": [
"security/ir.model.access.csv",
"security/sale_rental_security.xml",
"data/ir_crons.xml",
"data/mail_template_data.xml",
"data/rental_data.xml",
"data/rental_period.xml",
"views/stock_warehouse.xml",
"views/rental_pricing.xml",
"views/rental_period.xml",
"views/sale_rental.xml",
"wizard/create_rental_product_view.xml",
"wizard/rental_report_dashboard_view.xml",
"wizard/rental_report_wizard_view.xml",
"views/product.xml",
"views/res_config_settings_views.xml",
"views/sale_order.xml",
],
"demo": ["demo/rental_demo.xml"],
"installable": True,
}
11 changes: 11 additions & 0 deletions sale_rental/data/ir_crons.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo noupdate="1">
<record id="ir_cron_rental_return_reminder" model="ir.cron">
<field name="name">Rental Return Reminder</field>
<field name="model_id" ref="model_sale_rental" />
<field name="state">code</field>
<field name="code">model.cron_send_return_reminders()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="active">True</field>
</record>
</odoo>
43 changes: 43 additions & 0 deletions sale_rental/data/mail_template_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<odoo noupdate="1">
<record id="mail_template_rental_return_reminder" model="mail.template">
<field name="name">Rental Return Reminder</field>
<field name="model_id" ref="model_sale_rental" />
<field
name="subject"
>Reminder: Return of {{object.rented_product_id.display_name}} on {{format_date(object.end_datetime)}}</field>
<field name="email_from">{{object.company_id.email or user.email}}</field>
<field name="email_to">{{object.partner_id.email or ''}}</field>
<field name="auto_delete" eval="True" />
<field name="body_html" type="html">
<div>
<p>Hello <t t-out="object.partner_id.name or 'Customer'" />,</p>
<p>This is a friendly reminder that your rented item
<strong>
<t t-out="object.rented_product_id.display_name" />
</strong>
is due for return on <strong>
<t t-out="object.end_datetime" />
</strong>.
</p>

<p>
<strong>Rental details</strong>
</p>
<ul>
<li>Customer: <t t-out="object.partner_id.display_name" /></li>
<li>Rental service: <t
t-out="object.rental_product_id.display_name"
/></li>
<li>Start date: <t t-out="object.start_datetime" /></li>
<li>Return date: <t t-out="object.end_datetime" /></li>
<li>Quantity: <t t-out="object.items_qty" /></li>
<li>SO: <t t-out="object.start_order_id.name or ''" /></li>
</ul>

<p
>If you have any questions or need an extension, please reply to this email.</p>
<p>Best regards,<br /><t t-out="object.company_id.name" /></p>
</div>
</field>
</record>
</odoo>
24 changes: 24 additions & 0 deletions sale_rental/data/rental_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2014-2021 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
Copyright 2016-2021 Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="route_warehouse0_rental" model="stock.route">
<field name="name">Rent</field>
<field name="sequence">100</field>
<field name="warehouse_selectable" eval="True" />
<field name="product_selectable" eval="False" />
</record>

<record id="route_warehouse0_sell_rented_product" model="stock.route">
<field name="name">Sell Rented Product</field>
<field name="sequence">100</field>
</record>

<record id="stock.warehouse0" model="stock.warehouse">
<field name="rental_allowed" eval="True" />
</record>
</odoo>
33 changes: 33 additions & 0 deletions sale_rental/data/rental_period.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- data/rental_period_data.xml -->
<odoo noupdate="1">
<record id="rental_period_hour" model="rental.period">
<field name="name">Hour</field>
<field name="code">HOUR</field>
<field name="hours_per_unit">1</field>
<field name="sequence">1</field>
</record>
<record id="rental_period_day" model="rental.period">
<field name="name">Day</field>
<field name="code">DAY</field>
<field name="hours_per_unit">24</field>
<field name="sequence">2</field>
</record>
<record id="rental_period_week" model="rental.period">
<field name="name">Week</field>
<field name="code">WEEK</field>
<field name="hours_per_unit">168</field>
<field name="sequence">3</field>
</record>
<record id="rental_period_month" model="rental.period">
<field name="name">Month</field>
<field name="code">MONTH</field>
<field name="hours_per_unit">730</field>
<field name="sequence">4</field>
</record>
<record id="rental_period_year" model="rental.period">
<field name="name">Year</field>
<field name="code">YEAR</field>
<field name="hours_per_unit">8760</field>
<field name="sequence">5</field>
</record>
</odoo>
88 changes: 88 additions & 0 deletions sale_rental/demo/rental_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2014-2021 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
Copyright 2016-2021 Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="rent_consu_delivery_01" model="product.product">
<field name="name">Rental of one Three-Seat Sofa</field>
<field name="default_code">RENT-FURN_8999</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="sale_ok" eval="True" />
<field name="purchase_ok" eval="False" />
<field name="list_price">0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="must_have_dates" eval="True" />
<field name="rented_product_id" ref="product.consu_delivery_01" />
<!-- The 'stock' module sets it as type = 'product'
This XMLID is misleading -->
</record>

<record id="rent_product_product_20" model="product.product">
<field name="name">Rental of one Flipover</field>
<field name="default_code">RENT-FURN_9001</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="sale_ok" eval="True" />
<field name="purchase_ok" eval="False" />
<field name="list_price">0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="must_have_dates" eval="True" />
<field name="rented_product_id" ref="product.product_product_20" />
</record>

<record id="rent_product_product_25" model="product.product">
<field name="name">Rental of one Acoustic Bloc Screens</field>
<field name="default_code">RENT-FURN_6666</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="sale_ok" eval="True" />
<field name="purchase_ok" eval="False" />
<field name="list_price">0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="must_have_dates" eval="True" />
<field name="rented_product_id" ref="product.product_product_25" />
</record>

<!-- Sofa -->
<record id="pricing_sofa_day" model="product.rental.pricing">
<field name="product_id" ref="rent_consu_delivery_01" />
<field name="period_id" ref="sale_rental.rental_period_day" />
<field name="price">50.00</field>
</record>

<record id="pricing_sofa_week" model="product.rental.pricing">
<field name="product_id" ref="rent_consu_delivery_01" />
<field name="period_id" ref="sale_rental.rental_period_week" />
<field name="price">280.00</field>
</record>

<record id="pricing_sofa_month" model="product.rental.pricing">
<field name="product_id" ref="rent_consu_delivery_01" />
<field name="period_id" ref="sale_rental.rental_period_month" />
<field name="price">900.00</field>
</record>

<!-- Flipover -->
<record id="pricing_flipover_day" model="product.rental.pricing">
<field name="product_id" ref="rent_product_product_20" />
<field name="period_id" ref="sale_rental.rental_period_day" />
<field name="price">40.00</field>
</record>

<!-- Acoustic Bloc Screens -->
<record id="pricing_abs_day" model="product.rental.pricing">
<field name="product_id" ref="rent_product_product_25" />
<field name="period_id" ref="sale_rental.rental_period_day" />
<field name="price">60.00</field>
</record>

<!-- Create inventory on Rental In for these products -->
<function model="stock.quant" name="create_demo_and_validate" />
</odoo>
Loading
Loading