Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] sale_rental #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
117 changes: 117 additions & 0 deletions sale_rental/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
===========
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/16.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-16-0/vertical-rental-16-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=16.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*.

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)
* The unit of measure of the rental services must be *Day* (the rental per hour / per week / per month is not supported for the moment)

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:%2016.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 <[email protected]>
* Sodexis <[email protected]>
* Danh Vo <https://github.com/danhvophuong>
* Kiril Vangelovski <[email protected]>

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/16.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
28 changes: 28 additions & 0 deletions sale_rental/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2014-2021 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# Copyright 2016-2021 Sodexis (http://sodexis.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Rental",
"version": "16.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/rental_data.xml",
"views/sale_order.xml",
"views/stock_warehouse.xml",
"views/sale_rental.xml",
"wizard/create_rental_product_view.xml",
"views/product.xml",
],
"demo": ["demo/rental_demo.xml"],
"installable": True,
}
26 changes: 26 additions & 0 deletions sale_rental/data/rental_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2014-2021 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
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>
58 changes: 58 additions & 0 deletions sale_rental/demo/rental_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2014-2021 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
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">5</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_day" />
<field name="uom_po_id" ref="uom.product_uom_day" />
<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">4</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_day" />
<field name="uom_po_id" ref="uom.product_uom_day" />
<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">60</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_day" />
<field name="uom_po_id" ref="uom.product_uom_day" />
<field name="must_have_dates" eval="True" />
<field name="rented_product_id" ref="product.product_product_25" />
</record>

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


</odoo>
Loading
Loading