diff --git a/rental_base/README.rst b/rental_base/README.rst index cbe24209..912890ea 100644 --- a/rental_base/README.rst +++ b/rental_base/README.rst @@ -1,24 +1,45 @@ +=========== Rental Base -==================================================== +=========== -*This file has been generated on 2022-05-04-12-21-41. Changes to it will be overwritten.* +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3aa33913fc209f65f5d921f23e1f593e9e994d0753b589e5de2d93d567558aac + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -Summary -------- +.. |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/rental_base + :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-rental_base + :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 -Manage Rental of Products - -Description ------------ +|badge1| |badge2| |badge3| |badge4| |badge5| Base Module for Rental Management This module provides a new menu for rental management. It is based on the sale_rental module that currently can be found in sale-workflow repository. +**Table of contents** + +.. contents:: + :local: Usage ------ +===== Create a rentable product and its rental service. * Go to Rentals > Configuration > Settings. @@ -41,10 +62,54 @@ Create a rental order: Please also see the usage section of sale_rental module. Changelog ---------- +========= - 8d191ff7 2022-04-10 15:41:16 +0200 wagner@elegosoft.com add missing/lost documentation (issue #4516) - 39ff8efc 2022-03-14 15:15:31 +0100 cpatel@elegosoft.com [IMP] rental_tour correction, (issue#4516) - ac980b89 2022-02-28 17:36:28 +0100 cpatel@elegosoft.com [FIX][IMP] correct code, (issue#4516) - 4509f78a 2022-02-23 20:48:33 +0100 wagner@elegosoft.com (origin/feature_4516_add_files_ported_from_v12_v14, feature_4516_add_files_ported_from_v12_v14) add files ported to v14 by cpatel and khanhbui (issue #4516) +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 +~~~~~~~ + +* elego Software Solutions GmbH + +Contributors +~~~~~~~~~~~~ + +* elego Software Solutions GmbH + +* `Binhex `_: + + * Adasat Torres de León + * Zuzanna Elzbieta Szalaty Szalaty + +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. + +This module is part of the `OCA/vertical-rental `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/rental_base/README/CONTRIBUTORS.rst b/rental_base/README/CONTRIBUTORS.rst index 0f2e7ff6..9701fa9b 100644 --- a/rental_base/README/CONTRIBUTORS.rst +++ b/rental_base/README/CONTRIBUTORS.rst @@ -1,5 +1,6 @@ +* elego Software Solutions GmbH -Contributors ------------- +* `Binhex `_: -elego Software Solutions GmbH, Odoo Community Association (OCA) + * Adasat Torres de León + * Zuzanna Elzbieta Szalaty Szalaty diff --git a/rental_base/README/DESCRIPTION.rst b/rental_base/README/DESCRIPTION.rst index bc0f40be..0948fb46 100644 --- a/rental_base/README/DESCRIPTION.rst +++ b/rental_base/README/DESCRIPTION.rst @@ -1,16 +1,3 @@ -Rental Base -==================================================== - -*This file has been generated on 2022-05-04-12-21-41. Changes to it will be overwritten.* - -Summary -------- - -Manage Rental of Products - -Description ------------ - Base Module for Rental Management This module provides a new menu for rental management. diff --git a/rental_base/README/HISTORY.rst b/rental_base/README/HISTORY.rst index f2f1b77f..bdc61994 100644 --- a/rental_base/README/HISTORY.rst +++ b/rental_base/README/HISTORY.rst @@ -1,7 +1,3 @@ - -Changelog ---------- - - 8d191ff7 2022-04-10 15:41:16 +0200 wagner@elegosoft.com add missing/lost documentation (issue #4516) - 39ff8efc 2022-03-14 15:15:31 +0100 cpatel@elegosoft.com [IMP] rental_tour correction, (issue#4516) - ac980b89 2022-02-28 17:36:28 +0100 cpatel@elegosoft.com [FIX][IMP] correct code, (issue#4516) diff --git a/rental_base/README/USAGE.rst b/rental_base/README/USAGE.rst index b16e7ee0..a2a5df56 100644 --- a/rental_base/README/USAGE.rst +++ b/rental_base/README/USAGE.rst @@ -1,7 +1,3 @@ - -Usage ------ - Create a rentable product and its rental service. * Go to Rentals > Configuration > Settings. * Please activate the checkbox for using 'Product Variants'. diff --git a/rental_base/__init__.py b/rental_base/__init__.py index 75749508..7eb56335 100644 --- a/rental_base/__init__.py +++ b/rental_base/__init__.py @@ -1,4 +1,3 @@ # Part of rental-vertical See LICENSE file for full copyright and licensing details. from . import models -from . import tests from . import wizard diff --git a/rental_base/__manifest__.py b/rental_base/__manifest__.py index 10e3ae9b..99b23dcd 100644 --- a/rental_base/__manifest__.py +++ b/rental_base/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Rental Base", - "version": "14.0.1.0.1", + "version": "16.0.1.0.0", "category": "Rental", "summary": "Manage Rental of Products", "author": "elego Software Solutions GmbH, Odoo Community Association (OCA)", diff --git a/rental_base/models/product.py b/rental_base/models/product.py index ffaffe8f..d545121e 100644 --- a/rental_base/models/product.py +++ b/rental_base/models/product.py @@ -7,3 +7,9 @@ class ProductTemplate(models.Model): _inherit = "product.template" rental = fields.Boolean("Can be Rent") + + +class ProductProduct(models.Model): + _inherit = "product.product" + + rental = fields.Boolean("Can be Rent") diff --git a/rental_base/models/sale.py b/rental_base/models/sale.py index d52fbc55..e6869afa 100644 --- a/rental_base/models/sale.py +++ b/rental_base/models/sale.py @@ -1,5 +1,4 @@ # Part of rental-vertical See LICENSE file for full copyright and licensing details. - import datetime from odoo import _, api, exceptions, fields, models @@ -11,14 +10,12 @@ class SaleOrder(models.Model): _inherit = "sale.order" default_start_date = fields.Date( - string="Default Start Date", compute="_compute_default_start_date", readonly=False, store=True, ) default_end_date = fields.Date( - string="Default End Date", compute="_compute_default_end_date", readonly=False, store=True, @@ -106,49 +103,54 @@ def _check_sale_line_rental(self): if not line.extension_rental_id: raise ValidationError( _( - 'Missing "Rental to Extend" on the sale order line ' - "with rental service %s." + 'Missing "Rental to Extend" on the sale order line' + " with rental service %(name)s." ) - % line.product_id.name + % {"name": line.product_id.name} ) if line.rental_qty != line.extension_rental_id.rental_qty: raise ValidationError( _( - "On the sale order line with rental service %s, " - "you are trying to extend a rental with a rental " - "quantity (%s) that is different from the quantity " - "of the original rental (%s). This is not supported." - ) - % ( - line.product_id.name, - line.rental_qty, - line.extension_rental_id.rental_qty, + "On the sale order line with" + " rental service %(name)s" + " ,you are trying to extend a " + "rental with a rental " + "quantity (%(rental_qty)s) " + "that is different from the quantity " + "of the original rental " + "(%(ext_rental_qty)s). " + "This is not supported." ) + % { + "name": line.product_id.name, + "rental_qty": line.rental_qty, + "ext_rental_qty": line.extension_rental_id.rental_qty, + } ) if line.rental_type in ("new_rental", "rental_extension"): if not line.product_id.rented_product_id: raise ValidationError( _( 'On the "new rental" sale order line with product ' - '"%s", we should have a rental service product!' + '"%(name)s", we should have a rental service product!' ) - % (line.product_id.name) + % {"name": line.product_id.name} ) elif line.sell_rental_id: if line.product_uom_qty != line.sell_rental_id.rental_qty: raise ValidationError( _( - "On the sale order line with product %s " + "On the sale order line with product %(name)s " "you are trying to sell a rented product with a " - "quantity (%s) that is different from the rented " - "quantity (%s). This is not supported." - ) - % ( - line.product_id.name, - line.product_uom_qty, - line.sell_rental_id.rental_qty, + "quantity (%(qty)s) that is different from the rented " + "quantity (%(sell_rental_qty)s). This is not supported." ) + % { + "name": line.product_id.name, + "qty": line.product_uom_qty, + "sell_rental_qty": line.sell_rental_id.rental_qty, + } ) def _prepare_invoice_line(self, **optional_values): @@ -218,10 +220,10 @@ def update_start_end_date(self, date_start, date_end): ]: raise exceptions.UserError( _( - "Outgoing shipment is in state %s. You cannot change \ - the start date anymore." + "Outgoing shipment is in state %(state)s." + " You cannot change the start date anymore." ) - % rental.out_move_id.state + % {"state": rental.out_move_id.state} ) rental.out_move_id.date = datetime_start if rentals and date_end: @@ -235,10 +237,10 @@ def update_start_end_date(self, date_start, date_end): ]: raise exceptions.UserError( _( - "Incoming shipment is in state %s. You cannot change \ - the end date anymore." + "Incoming shipment is in state %s." + " You cannot change the end date anymore." ) - % rental.in_move_id.state + % {"state": rental.in_move_id.state} ) rental.in_move_id.date = datetime_end @@ -293,14 +295,17 @@ def write(self, values): if messages: messages.append( _( - "\nOrder: %s\n" - "Line with product: '%s'\n\n" + "\nOrder: %(order)s\n" + "Line with product: '%(product)s'\n\n" "Please use instead the button 'Update Times' " "in the order to correctly update the order " "line's times, its timeline entry, contract and " "its stock moves and pickings as required." ) - % (sol.order_id.name, sol.product_id.display_name) + % { + "order": sol.order_id.name, + "product": sol.product_id.display_name, + } ) raise exceptions.UserError("\n".join(messages)) - return super(SaleOrderLine, self).write(values) + return super().write(values) diff --git a/rental_base/static/description/index.html b/rental_base/static/description/index.html index cbcc7a7b..704f6e0b 100644 --- a/rental_base/static/description/index.html +++ b/rental_base/static/description/index.html @@ -1,20 +1,20 @@ - - + Rental Base