From 65210b74fc70425a1a527e3d5cb0b24c17d36d5c Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Tue, 24 Mar 2026 13:25:14 +0100 Subject: [PATCH] [ADD] product_catalog_sale_rental MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bridge between product_catalog_sale and sale_rental so that products added from the catalog on a rental order create proper rental lines with rental_type, rental_qty, start/end dates and the correct product_uom_qty (rental_qty × number_of_days). The start_date and end_date fields on sale.order.line are redefined with readonly=False to allow programmatic writes during create(), working around a circular dependency issue in the upstream sale_start_end_dates computes that prevents dates from being auto-filled when lines are created outside the form view. --- product_catalog_sale_rental/README.rst | 80 ++++ product_catalog_sale_rental/__init__.py | 1 + product_catalog_sale_rental/__manifest__.py | 21 + product_catalog_sale_rental/i18n/ca.po | 32 ++ product_catalog_sale_rental/i18n/es.po | 32 ++ .../models/__init__.py | 1 + .../models/sale_order.py | 100 ++++ .../readme/CONTRIBUTORS.rst | 3 + .../readme/DESCRIPTION.rst | 10 + .../static/description/icon.png | Bin 0 -> 6342 bytes .../static/description/index.html | 438 ++++++++++++++++++ .../views/product_views.xml | 20 + .../odoo/addons/product_catalog_sale_rental | 1 + setup/product_catalog_sale_rental/setup.py | 6 + 14 files changed, 745 insertions(+) create mode 100644 product_catalog_sale_rental/README.rst create mode 100644 product_catalog_sale_rental/__init__.py create mode 100644 product_catalog_sale_rental/__manifest__.py create mode 100644 product_catalog_sale_rental/i18n/ca.po create mode 100644 product_catalog_sale_rental/i18n/es.po create mode 100644 product_catalog_sale_rental/models/__init__.py create mode 100644 product_catalog_sale_rental/models/sale_order.py create mode 100644 product_catalog_sale_rental/readme/CONTRIBUTORS.rst create mode 100644 product_catalog_sale_rental/readme/DESCRIPTION.rst create mode 100644 product_catalog_sale_rental/static/description/icon.png create mode 100644 product_catalog_sale_rental/static/description/index.html create mode 100644 product_catalog_sale_rental/views/product_views.xml create mode 120000 setup/product_catalog_sale_rental/odoo/addons/product_catalog_sale_rental create mode 100644 setup/product_catalog_sale_rental/setup.py diff --git a/product_catalog_sale_rental/README.rst b/product_catalog_sale_rental/README.rst new file mode 100644 index 000000000..e59691cf1 --- /dev/null +++ b/product_catalog_sale_rental/README.rst @@ -0,0 +1,80 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========================== +Product Catalog Sale Rental +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e9928268ade75aa15031aa05051478fc4304b01a1912f001acc89733cf3c7b28 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-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-nuobit%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/nuobit/odoo-addons/tree/16.0/product_catalog_sale_rental + :alt: nuobit/odoo-addons + +|badge1| |badge2| |badge3| + +This module bridges ``product_catalog_sale`` with ``sale_rental`` so that +products added from the catalog on a rental order create proper rental lines. + +Without this module, the catalog creates regular sale order lines missing +``rental_type``, ``rental_qty`` and dates. This module overrides +``_update_order_line_info`` to automatically set these fields using the +order's default start and end dates. + +The catalog quantity represents the number of items to rent (``rental_qty``), +and ``product_uom_qty`` is computed as ``rental_qty × number_of_days``. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* NuoBiT Solutions SL + +Contributors +~~~~~~~~~~~~ + +* `NuoBiT `__: + + * Eric Antones + +Maintainers +~~~~~~~~~~~ + +This module is part of the `nuobit/odoo-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/product_catalog_sale_rental/__init__.py b/product_catalog_sale_rental/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/product_catalog_sale_rental/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_catalog_sale_rental/__manifest__.py b/product_catalog_sale_rental/__manifest__.py new file mode 100644 index 000000000..e5c96dde5 --- /dev/null +++ b/product_catalog_sale_rental/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2026 NuoBiT Solutions SL - Eric Antones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) + +{ + "name": "Product Catalog Sale Rental", + "summary": "Bridge between product catalog and rental modules" + " to create proper rental lines from the catalog.", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "category": "Rental", + "author": "NuoBiT Solutions SL", + "website": "https://github.com/nuobit/odoo-addons", + "license": "AGPL-3", + "depends": [ + "product_catalog_sale", + "sale_rental", + ], + "data": [ + "views/product_views.xml", + ], +} diff --git a/product_catalog_sale_rental/i18n/ca.po b/product_catalog_sale_rental/i18n/ca.po new file mode 100644 index 000000000..e8ca9c7ce --- /dev/null +++ b/product_catalog_sale_rental/i18n/ca.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_catalog_sale_rental +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-24 00:00+0000\n" +"PO-Revision-Date: 2026-03-24 00:00+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_catalog_sale_rental +#: code:addons/product_catalog_sale_rental/models/sale_order.py:0 +#, python-format +msgid "" +"Please set the start and end dates on the order before adding rental " +"products from the catalog." +msgstr "" +"Si us plau, establiu les dates d'inici i fi a la comanda abans d'afegir " +"productes de lloguer des del catàleg." + +#. module: product_catalog_sale_rental +#: model_terms:ir.ui.view,arch_db:product_catalog_sale_rental.product_view_search_catalog +msgid "Rental Products" +msgstr "Productes de lloguer" diff --git a/product_catalog_sale_rental/i18n/es.po b/product_catalog_sale_rental/i18n/es.po new file mode 100644 index 000000000..e787a1257 --- /dev/null +++ b/product_catalog_sale_rental/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_catalog_sale_rental +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-24 00:00+0000\n" +"PO-Revision-Date: 2026-03-24 00:00+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_catalog_sale_rental +#: code:addons/product_catalog_sale_rental/models/sale_order.py:0 +#, python-format +msgid "" +"Please set the start and end dates on the order before adding rental " +"products from the catalog." +msgstr "" +"Por favor, establezca las fechas de inicio y fin en el pedido antes de " +"añadir productos de alquiler desde el catálogo." + +#. module: product_catalog_sale_rental +#: model_terms:ir.ui.view,arch_db:product_catalog_sale_rental.product_view_search_catalog +msgid "Rental Products" +msgstr "Productos de alquiler" diff --git a/product_catalog_sale_rental/models/__init__.py b/product_catalog_sale_rental/models/__init__.py new file mode 100644 index 000000000..6aacb7531 --- /dev/null +++ b/product_catalog_sale_rental/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/product_catalog_sale_rental/models/sale_order.py b/product_catalog_sale_rental/models/sale_order.py new file mode 100644 index 000000000..3661fc8c4 --- /dev/null +++ b/product_catalog_sale_rental/models/sale_order.py @@ -0,0 +1,100 @@ +# Copyright 2026 NuoBiT Solutions SL - Eric Antones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) + +from odoo import _, fields, models +from odoo.exceptions import UserError + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + def _is_rental_order(self): + self.ensure_one() + rental_type = self.env.ref( + "rental_base.rental_sale_type", raise_if_not_found=False + ) + return bool(rental_type and self.type_id == rental_type) + + def _get_action_add_from_catalog_extra_context(self): + ctx = super()._get_action_add_from_catalog_extra_context() + if self._is_rental_order(): + ctx["search_default_rental_products"] = 1 + return ctx + + def _update_order_line_info(self, product_id, quantity, **kwargs): + product = self.env["product.product"].browse(product_id) + if not product.rented_product_id: + return super()._update_order_line_info(product_id, quantity, **kwargs) + if not self.default_start_date or not self.default_end_date: + raise UserError( + _( + "Please set the start and end dates on the order" + " before adding rental products from the catalog." + ) + ) + number_of_days = (self.default_end_date - self.default_start_date).days + 1 + sol = self.order_line.filtered(lambda line: line.product_id.id == product_id) + if sol: + if quantity != 0: + sol.rental_qty = quantity + sol.product_uom_qty = quantity * number_of_days + elif self.state in ["draft", "sent"]: + price_unit = self.pricelist_id._get_product_price( + product=sol.product_id, + quantity=1.0, + currency=self.currency_id, + date=self.date_order, + **kwargs, + ) + sol.unlink() + return price_unit + else: + sol.rental_qty = 0 + sol.product_uom_qty = 0 + elif quantity > 0: + sol = self.env["sale.order.line"].create( + { + "order_id": self.id, + "product_id": product_id, + "rental_type": "new_rental", + "rental_qty": quantity, + "start_date": self.default_start_date, + "end_date": self.default_end_date, + "product_uom_qty": quantity * number_of_days, + "sequence": ( + (self.order_line and self.order_line[-1].sequence + 1) or 10 + ), + } + ) + return sol.price_unit + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + start_date = fields.Date(readonly=False) + end_date = fields.Date(readonly=False) + + def _get_product_catalog_lines_data(self, **kwargs): + if self and self[0].rental_type: + if len(self) == 1: + res = { + "quantity": self.rental_qty, + "price": self.price_unit, + "readOnly": self.order_id._is_readonly() + or (self.product_id.sale_line_warn == "block"), + } + if ( + self.product_id.sale_line_warn != "no-message" + and self.product_id.sale_line_warn_msg + ): + res["warning"] = self.product_id.sale_line_warn_msg + return res + elif self: + self.product_id.ensure_one() + return { + "readOnly": True, + "price": self[0].price_unit, + "quantity": sum(self.mapped("rental_qty")), + } + return super()._get_product_catalog_lines_data(**kwargs) diff --git a/product_catalog_sale_rental/readme/CONTRIBUTORS.rst b/product_catalog_sale_rental/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..866096fcb --- /dev/null +++ b/product_catalog_sale_rental/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `NuoBiT `__: + + * Eric Antones diff --git a/product_catalog_sale_rental/readme/DESCRIPTION.rst b/product_catalog_sale_rental/readme/DESCRIPTION.rst new file mode 100644 index 000000000..1e5d98161 --- /dev/null +++ b/product_catalog_sale_rental/readme/DESCRIPTION.rst @@ -0,0 +1,10 @@ +This module bridges ``product_catalog_sale`` with ``sale_rental`` so that +products added from the catalog on a rental order create proper rental lines. + +Without this module, the catalog creates regular sale order lines missing +``rental_type``, ``rental_qty`` and dates. This module overrides +``_update_order_line_info`` to automatically set these fields using the +order's default start and end dates. + +The catalog quantity represents the number of items to rent (``rental_qty``), +and ``product_uom_qty`` is computed as ``rental_qty × number_of_days``. diff --git a/product_catalog_sale_rental/static/description/icon.png b/product_catalog_sale_rental/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd641e792c30455187ca30940bc0f329ce8bbb0 GIT binary patch literal 6342 zcmd^^hf`C}*TzHWpfm-MZa|7OjYtjE(4`3pP0Eid3J8V{0s)mKJ<q zp^9|rp$mb~2}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I4FW%LjHZKYGk#f~@3 zXW;a;3+{&c`g+uCR+``$V9)N#RBCk_#RQ(K-PxlQ7Ym;XdCqGn$j%JmAwgtkWKn1} z8^>3&)Q05VbBm+t`9B_${w9F7WfM{Jvawk;HDc*{Sa_Sla|zqX!vbKV%>gB|z6BCc z8_bdnPnzloGP1I)!^5hnC6CLZUU`;nO2NF2)FaAkYhQL$Z58+`p75dj7RKse#Z!uacCm z0@|m~U!QZOdb|V~`ktFK4;lg_ZOCjFXeV4`jGj&bh7Q6BEyN8~yGd*JyzwFbIRaAf z#KG$rvQxWFvqwn`i6jBQ?6o+k+oOC)Gj9ChlgabiScr};b5|opxUYjCZOwmhjTj6W zFzJt_htTuopW4IRiQ}r0L}`w=pE{HN<@(9Hl11P5cHmN6A1F^sg2OWXcw<+q2x>I5 zq9Bu>PBob6#^vrr<|IC)m+zJpFRRcCVsqbspNybriu&!R=H^@RcG#aBGz9RH}ZI=>4 zi(m?IA?Vr$Q7?wN6ZW7H`S?3}K8=$7J5MjWKri=_igw1%J?0~*6e_Ii*1&23dGcF} z&=vaMgF!^veGQ1f$3k?WK5Jaw%==+Bb!tI6zQ68&-dQ3Orl+Tqh#Nt?dBEV_w^wkjY+qJ+X*NCMs%J-Lc4%}pKryM#O)O&9 un*HHVB-AlUN`suyDkKONktc!@Ievk;6wT20MOSqhE{1gM*SZGeqiYU literal 0 HcmV?d00001 diff --git a/product_catalog_sale_rental/static/description/index.html b/product_catalog_sale_rental/static/description/index.html new file mode 100644 index 000000000..1c40afe9e --- /dev/null +++ b/product_catalog_sale_rental/static/description/index.html @@ -0,0 +1,438 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Catalog Sale Rental

+ +

Alpha License: AGPL-3 nuobit/odoo-addons

+

This module bridges product_catalog_sale with sale_rental so that +products added from the catalog on a rental order create proper rental lines.

+

Without this module, the catalog creates regular sale order lines missing +rental_type, rental_qty and dates. This module overrides +_update_order_line_info to automatically set these fields using the +order’s default start and end dates.

+

The catalog quantity represents the number of items to rent (rental_qty), +and product_uom_qty is computed as rental_qty × number_of_days.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions SL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the nuobit/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+
+ + diff --git a/product_catalog_sale_rental/views/product_views.xml b/product_catalog_sale_rental/views/product_views.xml new file mode 100644 index 000000000..9aa39ace5 --- /dev/null +++ b/product_catalog_sale_rental/views/product_views.xml @@ -0,0 +1,20 @@ + + + + + product.view.search.catalog.rental + product.product + + + + + + + + + diff --git a/setup/product_catalog_sale_rental/odoo/addons/product_catalog_sale_rental b/setup/product_catalog_sale_rental/odoo/addons/product_catalog_sale_rental new file mode 120000 index 000000000..caaab64d8 --- /dev/null +++ b/setup/product_catalog_sale_rental/odoo/addons/product_catalog_sale_rental @@ -0,0 +1 @@ +../../../../product_catalog_sale_rental \ No newline at end of file diff --git a/setup/product_catalog_sale_rental/setup.py b/setup/product_catalog_sale_rental/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/product_catalog_sale_rental/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)