diff --git a/rental_base_extension/README.rst b/rental_base_extension/README.rst index f5a320ea6..2e7845c59 100644 --- a/rental_base_extension/README.rst +++ b/rental_base_extension/README.rst @@ -26,24 +26,44 @@ Rental Base Extension |badge1| |badge2| |badge3| -This module extends ``rental_base`` to improve the rental order experience -with better menu visibility and product filtering. +This module extends ``rental_base`` to provide a complete rental order +management experience. + +Dedicated rental views +~~~~~~~~~~~~~~~~~~~~~~ + +Replaces the default sale order views with dedicated rental-specific views: +form, tree, kanban, calendar and search. The form view hides non-rental fields +and adds rental period, duration and status badges. Actions set the rental sale +type by default. + +Rental status tracking +~~~~~~~~~~~~~~~~~~~~~~ + +Adds computed ``rental_status`` on sale orders based on the state of the +underlying ``sale.rental`` records: draft, pickup, return, returned and cancel. +A "late" indicator warns when the next action date has passed. Rental Positions menu ~~~~~~~~~~~~~~~~~~~~~ -The ``rental_base`` module places the Rental Positions screen (the ``sale.rental`` -list) under Configuration and restricts it to debug mode. This module moves it -to the top level of the Rentals menu as the first entry, visible to all sales -users, since it is the primary screen for tracking rental status. +The ``rental_base`` module places the Rental Positions screen under +Configuration and restricts it to debug mode. This module moves it to the +top level of the Rentals menu as the first entry, visible to all sales users. Product filter on rental order lines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When creating a rental order, the product dropdown on order lines only shows -rental service products (i.e. products linked to a rented physical product -via ``rented_product_id``). This prevents users from accidentally selecting -non-rental products on rental orders. +When creating a rental order, the product dropdown only shows rental service +products, preventing users from accidentally selecting non-rental products. + +Signature and delivery +~~~~~~~~~~~~~~~~~~~~~~ + +Configurable signature terms for rental delivery orders (Settings → Rental → +Signature). When enabled, the Validate button is replaced by a Sign button +that auto-validates on signature. The signed conditions appear on the delivery +slip PDF. Catalan and Spanish translations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/rental_base_extension/__init__.py b/rental_base_extension/__init__.py index e69de29bb..0650744f6 100644 --- a/rental_base_extension/__init__.py +++ b/rental_base_extension/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/rental_base_extension/__manifest__.py b/rental_base_extension/__manifest__.py index 54fa78a22..2fc4f298a 100644 --- a/rental_base_extension/__manifest__.py +++ b/rental_base_extension/__manifest__.py @@ -3,9 +3,9 @@ { "name": "Rental Base Extension", - "summary": "Improves rental product form with checkbox visibility," - " rental sections and translations.", - "version": "16.0.1.0.0", + "summary": "Dedicated rental views, rental status tracking," + " kanban, calendar, configurable signature terms and translations.", + "version": "16.0.2.0.0", "development_status": "Alpha", "category": "Rental", "author": "NuoBiT Solutions SL", @@ -15,6 +15,17 @@ "rental_base", ], "data": [ + "report/report_deliveryslip.xml", "views/product_views.xml", + "views/sale_order_views.xml", + "views/res_config_settings_views.xml", + "views/stock_picking_views.xml", ], + "assets": { + "web.assets_backend": [ + "rental_base_extension/static/src/js/signature_widget.js", + "rental_base_extension/static/src/scss/rental_kanban.scss", + "rental_base_extension/static/src/xml/signature_dialog.xml", + ], + }, } diff --git a/rental_base_extension/i18n/ca.po b/rental_base_extension/i18n/ca.po index afc86479c..4c43e4d98 100644 --- a/rental_base_extension/i18n/ca.po +++ b/rental_base_extension/i18n/ca.po @@ -1,6 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * rental_base +# * rental_base_extension # msgid "" msgstr "" @@ -384,6 +385,7 @@ msgstr "" #. module: rental_base #: model:ir.model.fields,field_description:rental_base.field_update_sale_line_date__order_id +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental msgid "Order" msgstr "Comanda" @@ -414,6 +416,8 @@ msgstr "Temps de lloguer demanat" #. module: rental_base #: model:ir.ui.menu,name:rental_base.menu_customer_orders +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_orders msgid "Orders" msgstr "Comandes" @@ -490,6 +494,7 @@ msgstr "Comanda de lloguer" #. module: rental_base #: model:ir.actions.act_window,name:rental_base.action_rental_orders #: model:ir.ui.menu,name:rental_base.menu_rental_orders +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental msgid "Rental Orders" msgstr "Comandes de lloguer" @@ -597,6 +602,7 @@ msgstr "Actualitzar data de les línies de comanda de venda" #: model:ir.actions.act_window,name:rental_base.action_update_sale_line_date #: model_terms:ir.ui.view,arch_db:rental_base.update_sale_line_date_form #: model_terms:ir.ui.view,arch_db:rental_base.view_order_form +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental msgid "Update Times" msgstr "Actualitzar temps" @@ -651,3 +657,251 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:rental_base_extension.product_template_only_form_view msgid "Create Rental Service" msgstr "Crear servei de lloguer" + +#. module: rental_base_extension +#. odoo-javascript +#: code:addons/rental_base_extension/static/src/js/signature_widget.js:0 +#, python-format +msgid "Delivery Signature" +msgstr "Signatura de lliurament" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_res_company__rental_signature_terms +#: model:ir.model.fields,field_description:rental_base_extension.field_res_config_settings__rental_signature_terms +msgid "Rental Signature Terms" +msgstr "Condicions de signatura de lloguer" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.report_delivery_document_rental_signature_terms +msgid "Conditions" +msgstr "Condicions" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.report_delivery_document_rental_signature_terms +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "Signature" +msgstr "Signatura" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "" +"Terms shown in the signature dialog when signing a rental delivery order. " +"Leave empty to use the default text." +msgstr "" +"Condicions mostrades al diàleg de signatura en signar un albarà de lloguer. " +"Deixeu buit per utilitzar el text per defecte." + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__draft +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Quotation" +msgstr "Pressupost" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__sent +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Quotation Sent" +msgstr "Pressupost enviat" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__pickup +msgid "Reserved" +msgstr "Reservat" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__return +msgid "Pickedup" +msgstr "Recollit" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__returned +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Returned" +msgstr "Tornat" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Booked" +msgstr "Reservat" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Late Pickup" +msgstr "Recollida amb retard" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Picked-up" +msgstr "Recollit" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Late Return" +msgstr "Retorn amb retard" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "To Pickup" +msgstr "Per recollir" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "To Return" +msgstr "Per retornar" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__rental_duration +msgid "Duration" +msgstr "Durada" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__rental_status +msgid "Rental Status" +msgstr "Estat del lloguer" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Rental Period" +msgstr "Període de lloguer" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Search Rental Orders" +msgstr "Cerca comandes de lloguer" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "My Orders" +msgstr "Les meves comandes" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_today +msgid "To Do Today" +msgstr "Avui" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Late" +msgstr "Retard" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Pickup Date" +msgstr "Data de recollida" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Return Date" +msgstr "Data de devolució" + +#. module: rental_base_extension +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental_today_pickup +msgid "Pickups Today" +msgstr "Recollides avui" + +#. module: rental_base_extension +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental_today_return +msgid "Returns Today" +msgstr "Devolucions avui" + +#. module: rental_base_extension +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_today_pickup +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Pickup" +msgstr "Recollida" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Qty" +msgstr "Qtat" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_action_rental +msgid "Create a new rental order!" +msgstr "Crea una nova comanda de lloguer!" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Pickup:" +msgstr "Recollida:" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Return:" +msgstr "Retorn:" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "" +msgstr "" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__is_late +msgid "Is Late" +msgstr "Endarrerit" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__is_rental_order +msgid "Is Rental Order" +msgstr "És comanda de lloguer" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_stock_picking__is_rental_picking +msgid "Is Rental Picking" +msgstr "És albarà de lloguer" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__next_action_date +msgid "Next Action Date" +msgstr "Data propera acció" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__pickup_picking_id +msgid "Pickup Picking" +msgstr "Albarà de recollida" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__return_picking_id +msgid "Return Picking" +msgstr "Albarà de retorn" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_res_company__rental_require_signature_validation +#: model:ir.model.fields,field_description:rental_base_extension.field_res_config_settings__rental_require_signature_validation +#: model:ir.model.fields,field_description:rental_base_extension.field_stock_picking__rental_require_signature_validation +msgid "Rental Require Signature Validation" +msgstr "Requerir signatura per validar lloguer" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "Require Signature to Validate Delivery" +msgstr "Requerir signatura per validar l'entrega" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "When enabled, rental delivery orders can only be validated by signing. The Validate button is replaced by the Sign button." +msgstr "Si s'activa, les entregues de lloguer només es poden validar amb signatura. El botó Validar se substitueix pel botó Signar." + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.view_picking_form +msgid "Sign" +msgstr "Signar" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Salesperson" +msgstr "Comercial" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Status" +msgstr "Estat" + +#. module: rental_base_extension +#. odoo-javascript +#: code:addons/rental_base_extension/static/src/xml/signature_dialog.xml:0 +#, python-format +msgid "Confirm & Sign" +msgstr "Confirmar i signar" diff --git a/rental_base_extension/i18n/es.po b/rental_base_extension/i18n/es.po index 510a3b1f8..b90ac5f2c 100644 --- a/rental_base_extension/i18n/es.po +++ b/rental_base_extension/i18n/es.po @@ -1,6 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * rental_base +# * rental_base_extension # msgid "" msgstr "" @@ -394,6 +395,7 @@ msgstr "" #. module: rental_base #: model:ir.model.fields,field_description:rental_base.field_update_sale_line_date__order_id +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental msgid "Order" msgstr "Pedido" @@ -424,6 +426,8 @@ msgstr "Tiempo de alquiler pedido" #. module: rental_base #: model:ir.ui.menu,name:rental_base.menu_customer_orders +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_orders msgid "Orders" msgstr "Pedidos" @@ -500,6 +504,7 @@ msgstr "Pedido de alquiler" #. module: rental_base #: model:ir.actions.act_window,name:rental_base.action_rental_orders #: model:ir.ui.menu,name:rental_base.menu_rental_orders +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental msgid "Rental Orders" msgstr "Pedidos de alquiler" @@ -607,6 +612,7 @@ msgstr "Actualizar fecha de las líneas de pedido de venta" #: model:ir.actions.act_window,name:rental_base.action_update_sale_line_date #: model_terms:ir.ui.view,arch_db:rental_base.update_sale_line_date_form #: model_terms:ir.ui.view,arch_db:rental_base.view_order_form +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental msgid "Update Times" msgstr "Actualizar tiempos" @@ -663,3 +669,251 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:rental_base_extension.product_template_only_form_view msgid "Create Rental Service" msgstr "Crear servicio de alquiler" + +#. module: rental_base_extension +#. odoo-javascript +#: code:addons/rental_base_extension/static/src/js/signature_widget.js:0 +#, python-format +msgid "Delivery Signature" +msgstr "Firma de entrega" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_res_company__rental_signature_terms +#: model:ir.model.fields,field_description:rental_base_extension.field_res_config_settings__rental_signature_terms +msgid "Rental Signature Terms" +msgstr "Condiciones de firma de alquiler" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.report_delivery_document_rental_signature_terms +msgid "Conditions" +msgstr "Condiciones" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.report_delivery_document_rental_signature_terms +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "Signature" +msgstr "Firma" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "" +"Terms shown in the signature dialog when signing a rental delivery order. " +"Leave empty to use the default text." +msgstr "" +"Condiciones mostradas en el diálogo de firma al firmar un albarán de alquiler. " +"Dejar vacío para utilizar el texto por defecto." + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__draft +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Quotation" +msgstr "Presupuesto" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__sent +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Quotation Sent" +msgstr "Presupuesto enviado" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__pickup +msgid "Reserved" +msgstr "Reservado" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__return +msgid "Pickedup" +msgstr "Recogida" + +#. module: rental_base_extension +#: model:ir.model.fields.selection,name:rental_base_extension.selection__sale_order__rental_status__returned +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Returned" +msgstr "Devuelto" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Booked" +msgstr "Reservado" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Late Pickup" +msgstr "Recogida con retraso" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Picked-up" +msgstr "Recogida" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Late Return" +msgstr "Retorno con retraso" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "To Pickup" +msgstr "Por recoger" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "To Return" +msgstr "Por devolver" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__rental_duration +msgid "Duration" +msgstr "Duración" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__rental_status +msgid "Rental Status" +msgstr "Estado de alquiler" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Rental Period" +msgstr "Periodo de alquiler" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Search Rental Orders" +msgstr "Buscar órdenes de alquiler" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "My Orders" +msgstr "Mis pedidos" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_today +msgid "To Do Today" +msgstr "Hoy" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Late" +msgstr "Retraso" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Pickup Date" +msgstr "Fecha de recogida" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Return Date" +msgstr "Fecha de retorno" + +#. module: rental_base_extension +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental_today_pickup +msgid "Pickups Today" +msgstr "Recogidas hoy" + +#. module: rental_base_extension +#: model:ir.actions.act_window,name:rental_base_extension.sale_order_action_rental_today_return +msgid "Returns Today" +msgstr "Devoluciones hoy" + +#. module: rental_base_extension +#: model:ir.ui.menu,name:rental_base_extension.sale_order_menu_rental_today_pickup +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Pickup" +msgstr "Recogida" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_form_rental +msgid "Qty" +msgstr "Ctd" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_action_rental +msgid "Create a new rental order!" +msgstr "¡Crea una nueva orden de alquiler!" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Pickup:" +msgstr "Recogida:" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "Return:" +msgstr "Retorno:" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_kanban_rental +msgid "" +msgstr "" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__is_late +msgid "Is Late" +msgstr "Atrasado" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__is_rental_order +msgid "Is Rental Order" +msgstr "Es pedido de alquiler" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_stock_picking__is_rental_picking +msgid "Is Rental Picking" +msgstr "Es albarán de alquiler" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__next_action_date +msgid "Next Action Date" +msgstr "Fecha próxima acción" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__pickup_picking_id +msgid "Pickup Picking" +msgstr "Albarán de recogida" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_sale_order__return_picking_id +msgid "Return Picking" +msgstr "Albarán de retorno" + +#. module: rental_base_extension +#: model:ir.model.fields,field_description:rental_base_extension.field_res_company__rental_require_signature_validation +#: model:ir.model.fields,field_description:rental_base_extension.field_res_config_settings__rental_require_signature_validation +#: model:ir.model.fields,field_description:rental_base_extension.field_stock_picking__rental_require_signature_validation +msgid "Rental Require Signature Validation" +msgstr "Requerir firma para validar alquiler" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "Require Signature to Validate Delivery" +msgstr "Requerir firma para validar la entrega" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.res_config_settings_view_form +msgid "When enabled, rental delivery orders can only be validated by signing. The Validate button is replaced by the Sign button." +msgstr "Si se activa, las entregas de alquiler solo se pueden validar con firma. El botón Validar se sustituye por el botón Firmar." + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.view_picking_form +msgid "Sign" +msgstr "Firmar" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Salesperson" +msgstr "Comercial" + +#. module: rental_base_extension +#: model_terms:ir.ui.view,arch_db:rental_base_extension.sale_order_view_search_rental +msgid "Status" +msgstr "Estado" + +#. module: rental_base_extension +#. odoo-javascript +#: code:addons/rental_base_extension/static/src/xml/signature_dialog.xml:0 +#, python-format +msgid "Confirm & Sign" +msgstr "Confirmar y firmar" diff --git a/rental_base_extension/models/__init__.py b/rental_base_extension/models/__init__.py new file mode 100644 index 000000000..ba1c090c8 --- /dev/null +++ b/rental_base_extension/models/__init__.py @@ -0,0 +1,4 @@ +from . import res_company +from . import res_config_settings +from . import sale_order +from . import stock_picking diff --git a/sale_rental_extension/models/res_company.py b/rental_base_extension/models/res_company.py similarity index 100% rename from sale_rental_extension/models/res_company.py rename to rental_base_extension/models/res_company.py diff --git a/sale_rental_extension/models/res_config_settings.py b/rental_base_extension/models/res_config_settings.py similarity index 100% rename from sale_rental_extension/models/res_config_settings.py rename to rental_base_extension/models/res_config_settings.py diff --git a/sale_rental_extension/models/sale_order.py b/rental_base_extension/models/sale_order.py similarity index 59% rename from sale_rental_extension/models/sale_order.py rename to rental_base_extension/models/sale_order.py index 61d10ebe0..2fb3fd29c 100644 --- a/sale_rental_extension/models/sale_order.py +++ b/rental_base_extension/models/sale_order.py @@ -1,8 +1,7 @@ # Copyright 2026 NuoBiT Solutions SL - Eric Antones # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from odoo import api, fields, models RENTAL_STATUS = [ ("draft", "Quotation"), @@ -133,85 +132,3 @@ def _compute_is_late(self): order.is_late = bool( order.next_action_date and order.next_action_date < today ) - - -class SaleOrderLine(models.Model): - _inherit = "sale.order.line" - - rental_qty = fields.Float( - readonly=True, - states={ - "draft": [("readonly", False)], - "sent": [("readonly", False)], - "sale": [("readonly", False)], - }, - ) - - @api.onchange("product_id", "rental_qty") - def rental_product_id_change(self): - res = super().rental_product_id_change() - if ( - self.product_id.rented_product_id - and self.rental_type == "new_rental" - and not self.rental_qty - ): - self.rental_qty = 1 - return res - - def _action_launch_stock_rule(self, previous_product_uom_qty=False): - if self._context.get("skip_procurement"): - return True - return super()._action_launch_stock_rule( - previous_product_uom_qty=previous_product_uom_qty - ) - - def write(self, values): - if "rental_qty" in values: - rental_lines = self.filtered( - lambda l: l.state in ("sale", "done") - and l.rental_type == "new_rental" - and l.product_id.rented_product_id - ) - for line in rental_lines: - rental = self.env["sale.rental"].search( - [("start_order_line_id", "=", line.id)], limit=1 - ) - if rental and rental.out_move_id.state == "done": - raise UserError( - _( - "Cannot change rental quantity after pickup " - "for product '%s'.", - line.product_id.display_name, - ) - ) - else: - rental_lines = self.env["sale.order.line"] - - res = super().write(values) - - for line in rental_lines: - new_qty = line.rental_qty * line.number_of_days - if line.product_uom_qty != new_qty: - line.with_context(skip_procurement=True).write( - {"product_uom_qty": new_qty} - ) - rental = self.env["sale.rental"].search( - [("start_order_line_id", "=", line.id)], limit=1 - ) - if rental: - moves_to_update = self.env["stock.move"] - if rental.out_move_id and rental.out_move_id.state not in ( - "done", - "cancel", - ): - moves_to_update |= rental.out_move_id - if rental.in_move_id and rental.in_move_id.state not in ( - "done", - "cancel", - ): - moves_to_update |= rental.in_move_id - if moves_to_update: - moves_to_update.move_line_ids.write({"qty_done": 0}) - moves_to_update.write({"product_uom_qty": line.rental_qty}) - - return res diff --git a/sale_rental_extension/models/stock_picking.py b/rental_base_extension/models/stock_picking.py similarity index 100% rename from sale_rental_extension/models/stock_picking.py rename to rental_base_extension/models/stock_picking.py diff --git a/rental_base_extension/readme/DESCRIPTION.rst b/rental_base_extension/readme/DESCRIPTION.rst index 965535953..49dfcc6ed 100644 --- a/rental_base_extension/readme/DESCRIPTION.rst +++ b/rental_base_extension/readme/DESCRIPTION.rst @@ -1,21 +1,41 @@ -This module extends ``rental_base`` to improve the rental order experience -with better menu visibility and product filtering. +This module extends ``rental_base`` to provide a complete rental order +management experience. + +Dedicated rental views +~~~~~~~~~~~~~~~~~~~~~~ + +Replaces the default sale order views with dedicated rental-specific views: +form, tree, kanban, calendar and search. The form view hides non-rental fields +and adds rental period, duration and status badges. Actions set the rental sale +type by default. + +Rental status tracking +~~~~~~~~~~~~~~~~~~~~~~ + +Adds computed ``rental_status`` on sale orders based on the state of the +underlying ``sale.rental`` records: draft, pickup, return, returned and cancel. +A "late" indicator warns when the next action date has passed. Rental Positions menu ~~~~~~~~~~~~~~~~~~~~~ -The ``rental_base`` module places the Rental Positions screen (the ``sale.rental`` -list) under Configuration and restricts it to debug mode. This module moves it -to the top level of the Rentals menu as the first entry, visible to all sales -users, since it is the primary screen for tracking rental status. +The ``rental_base`` module places the Rental Positions screen under +Configuration and restricts it to debug mode. This module moves it to the +top level of the Rentals menu as the first entry, visible to all sales users. Product filter on rental order lines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When creating a rental order, the product dropdown on order lines only shows -rental service products (i.e. products linked to a rented physical product -via ``rented_product_id``). This prevents users from accidentally selecting -non-rental products on rental orders. +When creating a rental order, the product dropdown only shows rental service +products, preventing users from accidentally selecting non-rental products. + +Signature and delivery +~~~~~~~~~~~~~~~~~~~~~~ + +Configurable signature terms for rental delivery orders (Settings → Rental → +Signature). When enabled, the Validate button is replaced by a Sign button +that auto-validates on signature. The signed conditions appear on the delivery +slip PDF. Catalan and Spanish translations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/sale_rental_extension/report/report_deliveryslip.xml b/rental_base_extension/report/report_deliveryslip.xml similarity index 100% rename from sale_rental_extension/report/report_deliveryslip.xml rename to rental_base_extension/report/report_deliveryslip.xml diff --git a/rental_base_extension/static/description/index.html b/rental_base_extension/static/description/index.html index dad4f9149..fb99c2d80 100644 --- a/rental_base_extension/static/description/index.html +++ b/rental_base_extension/static/description/index.html @@ -375,21 +375,38 @@

Rental Base Extension

!! source digest: sha256:09ab96bf14c0b83294c077459048e953907a79975688866d7ca219537c451e41 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 nuobit/odoo-addons

-

This module extends rental_base to improve the rental order experience -with better menu visibility and product filtering.

+

This module extends rental_base to provide a complete rental order +management experience.

+
+

Dedicated rental views

+

Replaces the default sale order views with dedicated rental-specific views: +form, tree, kanban, calendar and search. The form view hides non-rental fields +and adds rental period, duration and status badges. Actions set the rental sale +type by default.

+
+
+

Rental status tracking

+

Adds computed rental_status on sale orders based on the state of the +underlying sale.rental records: draft, pickup, return, returned and cancel. +A “late” indicator warns when the next action date has passed.

+

Rental Positions menu

-

The rental_base module places the Rental Positions screen (the sale.rental -list) under Configuration and restricts it to debug mode. This module moves it -to the top level of the Rentals menu as the first entry, visible to all sales -users, since it is the primary screen for tracking rental status.

+

The rental_base module places the Rental Positions screen under +Configuration and restricts it to debug mode. This module moves it to the +top level of the Rentals menu as the first entry, visible to all sales users.

Product filter on rental order lines

-

When creating a rental order, the product dropdown on order lines only shows -rental service products (i.e. products linked to a rented physical product -via rented_product_id). This prevents users from accidentally selecting -non-rental products on rental orders.

+

When creating a rental order, the product dropdown only shows rental service +products, preventing users from accidentally selecting non-rental products.

+
+
+

Signature and delivery

+

Configurable signature terms for rental delivery orders (Settings → Rental → +Signature). When enabled, the Validate button is replaced by a Sign button +that auto-validates on signature. The signed conditions appear on the delivery +slip PDF.

Catalan and Spanish translations

diff --git a/sale_rental_extension/static/src/js/.eslintrc.yml b/rental_base_extension/static/src/js/.eslintrc.yml similarity index 100% rename from sale_rental_extension/static/src/js/.eslintrc.yml rename to rental_base_extension/static/src/js/.eslintrc.yml diff --git a/sale_rental_extension/static/src/js/signature_widget.js b/rental_base_extension/static/src/js/signature_widget.js similarity index 94% rename from sale_rental_extension/static/src/js/signature_widget.js rename to rental_base_extension/static/src/js/signature_widget.js index a91d14c4d..2b321fbe9 100644 --- a/sale_rental_extension/static/src/js/signature_widget.js +++ b/rental_base_extension/static/src/js/signature_widget.js @@ -6,7 +6,7 @@ import {SignatureDialog} from "@web/core/signature/signature_dialog"; import {SignatureWidget} from "@web/views/widgets/signature/signature"; import {patch} from "web.utils"; -patch(SignatureWidget.prototype, "sale_rental_extension.SignatureWidget", { +patch(SignatureWidget.prototype, "rental_base_extension.SignatureWidget", { async onClickSignature() { const {record} = this.props; const isRental = @@ -56,7 +56,7 @@ patch(SignatureWidget.prototype, "sale_rental_extension.SignatureWidget", { }, }); -patch(SignatureDialog.prototype, "sale_rental_extension.SignatureDialog", { +patch(SignatureDialog.prototype, "rental_base_extension.SignatureDialog", { setup() { this._super(...arguments); if (this.props.isRental) { diff --git a/sale_rental_extension/static/src/scss/sale_rental_kanban.scss b/rental_base_extension/static/src/scss/rental_kanban.scss similarity index 100% rename from sale_rental_extension/static/src/scss/sale_rental_kanban.scss rename to rental_base_extension/static/src/scss/rental_kanban.scss diff --git a/sale_rental_extension/static/src/xml/signature_dialog.xml b/rental_base_extension/static/src/xml/signature_dialog.xml similarity index 96% rename from sale_rental_extension/static/src/xml/signature_dialog.xml rename to rental_base_extension/static/src/xml/signature_dialog.xml index 7d5f562fa..dcc81e89c 100644 --- a/sale_rental_extension/static/src/xml/signature_dialog.xml +++ b/rental_base_extension/static/src/xml/signature_dialog.xml @@ -4,7 +4,7 @@ res.config.settings.view.form.inherit.sale_rental_extension + >res.config.settings.view.form.inherit.rental_base_extension res.config.settings diff --git a/sale_rental_extension/views/sale_order_rental_views.xml b/rental_base_extension/views/sale_order_views.xml similarity index 86% rename from sale_rental_extension/views/sale_order_rental_views.xml rename to rental_base_extension/views/sale_order_views.xml index d1940d1cb..6655fdc29 100644 --- a/sale_rental_extension/views/sale_order_rental_views.xml +++ b/rental_base_extension/views/sale_order_views.xml @@ -25,8 +25,8 @@ - - sale.order.form.rental + + sale.order.view.form.rental sale.order primary @@ -197,8 +197,8 @@ - - sale.order.tree.rental + + sale.order.view.tree.rental sale.order @@ -232,8 +232,8 @@ - - sale.order.kanban.rental + + sale.order.view.kanban.rental sale.order @@ -334,8 +334,8 @@ - - sale.order.calendar.rental + + sale.order.view.calendar.rental sale.order - - sale.order.search.rental + + sale.order.view.search.rental sale.order 100 @@ -456,11 +456,11 @@ - + Rental Orders sale.order tree,kanban,form,calendar,pivot,graph,activity - + + 1 kanban - - + + - + 2 tree - - + + - + 3 form - - + + - + 4 calendar - - + + - + Pickups Today sale.order tree,kanban,form [('is_rental_order', '=', True)] - + 1 tree - - + + 2 kanban - - + + 3 form - - + + - + Returns Today sale.order tree,kanban,form [('is_rental_order', '=', True)] - + 1 tree - - + + 2 kanban - - + + 3 form - - + + @@ -596,7 +602,7 @@ Orders --> @@ -628,27 +634,27 @@ diff --git a/sale_rental_extension/views/stock_picking_views.xml b/rental_base_extension/views/stock_picking_views.xml similarity index 98% rename from sale_rental_extension/views/stock_picking_views.xml rename to rental_base_extension/views/stock_picking_views.xml index f5f058ff3..9370dad8b 100644 --- a/sale_rental_extension/views/stock_picking_views.xml +++ b/rental_base_extension/views/stock_picking_views.xml @@ -3,7 +3,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - stock.picking.form.inherit.sale_rental_extension + stock.picking.form.inherit.rental_base_extension stock.picking diff --git a/sale_rental_extension/README.rst b/sale_rental_extension/README.rst index 09e607c1e..b444745e0 100644 --- a/sale_rental_extension/README.rst +++ b/sale_rental_extension/README.rst @@ -30,9 +30,8 @@ This module extends ``sale_rental`` to improve the rental positions experience: * Kanban and calendar views for the Rental Positions screen * Searchpanel with state filter and "Today" filter -* Configurable signature terms for rental delivery orders - (Settings → Rental → Signature) -* Custom signature dialog with "Confirm & Sign" button on rental pickings +* Rental quantity defaults to 1 when adding a rental product +* Rental quantity can be edited on confirmed orders (before pickup) * Catalan and Spanish translations .. IMPORTANT:: diff --git a/sale_rental_extension/__manifest__.py b/sale_rental_extension/__manifest__.py index 39784cb9b..9d0c28b63 100644 --- a/sale_rental_extension/__manifest__.py +++ b/sale_rental_extension/__manifest__.py @@ -3,9 +3,9 @@ { "name": "Sale Rental Extension", - "summary": "Dedicated rental views, rental status tracking," - " kanban, calendar, configurable signature terms and translations.", - "version": "16.0.1.4.0", + "summary": "Rental position kanban, calendar views," + " rental quantity defaults and inline editing improvements.", + "version": "16.0.1.5.0", "development_status": "Alpha", "category": "Rental", "author": "NuoBiT Solutions SL", @@ -15,17 +15,6 @@ "sale_rental", ], "data": [ - "report/report_deliveryslip.xml", - "views/sale_order_rental_views.xml", - "views/res_config_settings_views.xml", "views/sale_rental_views.xml", - "views/stock_picking_views.xml", ], - "assets": { - "web.assets_backend": [ - "sale_rental_extension/static/src/js/signature_widget.js", - "sale_rental_extension/static/src/scss/sale_rental_kanban.scss", - "sale_rental_extension/static/src/xml/signature_dialog.xml", - ], - }, } diff --git a/sale_rental_extension/i18n/ca.po b/sale_rental_extension/i18n/ca.po index ce0ef67ad..aee7faadd 100644 --- a/sale_rental_extension/i18n/ca.po +++ b/sale_rental_extension/i18n/ca.po @@ -64,9 +64,7 @@ msgid "Cancel" msgstr "Cancel·la" #. module: sale_rental -#. module: sale_rental_extension #: model:ir.model.fields.selection,name:sale_rental.selection__sale_rental__state__cancel -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__cancel msgid "Cancelled" msgstr "Cancel·lat" @@ -486,10 +484,8 @@ msgid "Rental to Sell" msgstr "Lloguer a vendre" #. module: sale_rental -#. module: sale_rental_extension #: model:ir.actions.act_window,name:sale_rental.sale_rental_action #: model:ir.ui.menu,name:sale_rental.sale_rental_menu -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search msgid "Rentals" msgstr "Lloguers" @@ -501,11 +497,8 @@ msgid "Rented Product" msgstr "Producte llogat" #. module: sale_rental -#. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental.sale_rental_form #: model_terms:ir.ui.view,arch_db:sale_rental.sale_rental_tree -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today_return -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view msgid "Return" msgstr "Retorn" @@ -686,288 +679,17 @@ msgstr "" "d'estoc '%(rental_name)s'! Assegureu-vos que recupereu algunes unitats " "mentrestant o reaprovisioneu la ubicació d'estoc '%(rental_name)s'." -#. module: sale_rental_extension -#. odoo-javascript -#: code:addons/sale_rental_extension/static/src/js/signature_widget.js:0 -#, python-format -msgid "Delivery Signature" -msgstr "Signatura de lliurament" - -#. module: sale_rental_extension -#. odoo-javascript -#: code:addons/sale_rental_extension/static/src/xml/signature_dialog.xml:0 -#, python-format -msgid "Confirm & Sign" -msgstr "Confirmar i signar" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_company__rental_signature_terms -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_config_settings__rental_signature_terms -msgid "Rental Signature Terms" -msgstr "Condicions de signatura de lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.report_delivery_document_rental_signature_terms -msgid "Conditions" -msgstr "Condicions" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.report_delivery_document_rental_signature_terms -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "Signature" -msgstr "Signatura" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "" -"Terms shown in the signature dialog when signing a rental delivery order. " -"Leave empty to use the default text." -msgstr "" -"Condicions mostrades al diàleg de signatura en signar un albarà de lloguer. " -"Deixeu buit per utilitzar el text per defecte." - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__draft -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Quotation" -msgstr "Pressupost" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__sent -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Quotation Sent" -msgstr "Pressupost enviat" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__pickup -msgid "Reserved" -msgstr "Reservat" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__return -msgid "Pickedup" -msgstr "Recollit" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__returned -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Returned" -msgstr "Tornat" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Booked" -msgstr "Reservat" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Late Pickup" -msgstr "Recollida amb retard" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Picked-up" -msgstr "Recollit" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Late Return" -msgstr "Retorn amb retard" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "To Pickup" -msgstr "Per recollir" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "To Return" -msgstr "Per retornar" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__rental_duration -msgid "Duration" -msgstr "Durada" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__rental_status -msgid "Rental Status" -msgstr "Estat del lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Rental Period" -msgstr "Període de lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Update Times" -msgstr "Actualitzar dates" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_action -msgid "Rental Orders" -msgstr "Comandes de lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Search Rental Orders" -msgstr "Cerca comandes de lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "My Orders" -msgstr "Les meves comandes" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today -msgid "To Do Today" -msgstr "Avui" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Late" -msgstr "Retard" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Pickup Date" -msgstr "Data de recollida" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Return Date" -msgstr "Data de devolució" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_today_pickup_action -msgid "Pickups Today" -msgstr "Recollides avui" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_today_return_action -msgid "Returns Today" -msgstr "Devolucions avui" - -#. module: sale_rental_extension -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_order_group -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_orders -msgid "Orders" -msgstr "Comandes" - -#. module: sale_rental_extension -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today_pickup -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Pickup" -msgstr "Recollida" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Qty" -msgstr "Qtat" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_action -msgid "Create a new rental order!" -msgstr "Crea una nova comanda de lloguer!" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Pickup:" -msgstr "Recollida:" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Return:" -msgstr "Retorn:" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_view_kanban msgid "" msgstr "" -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "" -msgstr "" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_view_kanban msgid "" msgstr "" -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__is_late -msgid "Is Late" -msgstr "Endarrerit" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__is_rental_order -msgid "Is Rental Order" -msgstr "És comanda de lloguer" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_stock_picking__is_rental_picking -msgid "Is Rental Picking" -msgstr "És albarà de lloguer" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__next_action_date -msgid "Next Action Date" -msgstr "Data propera acció" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Order" -msgstr "Comanda" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__pickup_picking_id -msgid "Pickup Picking" -msgstr "Albarà de recollida" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__return_picking_id -msgid "Return Picking" -msgstr "Albarà de retorn" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_company__rental_require_signature_validation -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_config_settings__rental_require_signature_validation -#: model:ir.model.fields,field_description:sale_rental_extension.field_stock_picking__rental_require_signature_validation -msgid "Rental Require Signature Validation" -msgstr "Requerir signatura per validar lloguer" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "Require Signature to Validate Delivery" -msgstr "Requerir signatura per validar l'entrega" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "When enabled, rental delivery orders can only be validated by signing. The Validate button is replaced by the Sign button." -msgstr "Si s'activa, les entregues de lloguer només es poden validar amb signatura. El botó Validar se substitueix pel botó Signar." - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.view_picking_form -msgid "Sign" -msgstr "Signar" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Salesperson" -msgstr "Comercial" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Status" -msgstr "Estat" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_search msgid "Today" msgstr "Avui" - - diff --git a/sale_rental_extension/i18n/es.po b/sale_rental_extension/i18n/es.po index cc6eb9365..0be6226eb 100644 --- a/sale_rental_extension/i18n/es.po +++ b/sale_rental_extension/i18n/es.po @@ -64,9 +64,7 @@ msgid "Cancel" msgstr "Cancelar" #. module: sale_rental -#. module: sale_rental_extension #: model:ir.model.fields.selection,name:sale_rental.selection__sale_rental__state__cancel -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__cancel msgid "Cancelled" msgstr "Cancelado" @@ -486,10 +484,8 @@ msgid "Rental to Sell" msgstr "Alquiler a vender" #. module: sale_rental -#. module: sale_rental_extension #: model:ir.actions.act_window,name:sale_rental.sale_rental_action #: model:ir.ui.menu,name:sale_rental.sale_rental_menu -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search msgid "Rentals" msgstr "Alquileres" @@ -501,11 +497,8 @@ msgid "Rented Product" msgstr "Producto alquilado" #. module: sale_rental -#. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental.sale_rental_form #: model_terms:ir.ui.view,arch_db:sale_rental.sale_rental_tree -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today_return -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view msgid "Return" msgstr "Retorno" @@ -686,288 +679,17 @@ msgstr "" "stock '%(rental_name)s'. Asegúrese de recuperar algunas unidades mientras " "tanto o reaprovisione la ubicación de stock '%(rental_name)s'." -#. module: sale_rental_extension -#. odoo-javascript -#: code:addons/sale_rental_extension/static/src/js/signature_widget.js:0 -#, python-format -msgid "Delivery Signature" -msgstr "Firma de entrega" - -#. module: sale_rental_extension -#. odoo-javascript -#: code:addons/sale_rental_extension/static/src/xml/signature_dialog.xml:0 -#, python-format -msgid "Confirm & Sign" -msgstr "Confirmar y firmar" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_company__rental_signature_terms -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_config_settings__rental_signature_terms -msgid "Rental Signature Terms" -msgstr "Condiciones de firma de alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.report_delivery_document_rental_signature_terms -msgid "Conditions" -msgstr "Condiciones" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.report_delivery_document_rental_signature_terms -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "Signature" -msgstr "Firma" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "" -"Terms shown in the signature dialog when signing a rental delivery order. " -"Leave empty to use the default text." -msgstr "" -"Condiciones mostradas en el diálogo de firma al firmar un albarán de alquiler. " -"Dejar vacío para utilizar el texto por defecto." - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__draft -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Quotation" -msgstr "Presupuesto" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__sent -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Quotation Sent" -msgstr "Presupuesto enviado" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__pickup -msgid "Reserved" -msgstr "Reservado" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__return -msgid "Pickedup" -msgstr "Recogida" - -#. module: sale_rental_extension -#: model:ir.model.fields.selection,name:sale_rental_extension.selection__sale_order__rental_status__returned -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Returned" -msgstr "Devuelto" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Booked" -msgstr "Reservado" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Late Pickup" -msgstr "Recogida con retraso" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Picked-up" -msgstr "Recogida" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Late Return" -msgstr "Retorno con retraso" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "To Pickup" -msgstr "Por recoger" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "To Return" -msgstr "Por devolver" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__rental_duration -msgid "Duration" -msgstr "Duración" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__rental_status -msgid "Rental Status" -msgstr "Estado de alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Rental Period" -msgstr "Periodo de alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Update Times" -msgstr "Actualizar fechas" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_action -msgid "Rental Orders" -msgstr "Órdenes de alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Search Rental Orders" -msgstr "Buscar órdenes de alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "My Orders" -msgstr "Mis pedidos" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today -msgid "To Do Today" -msgstr "Hoy" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Late" -msgstr "Retraso" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Pickup Date" -msgstr "Fecha de recogida" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Return Date" -msgstr "Fecha de retorno" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_today_pickup_action -msgid "Pickups Today" -msgstr "Recogidas hoy" - -#. module: sale_rental_extension -#: model:ir.actions.act_window,name:sale_rental_extension.rental_order_today_return_action -msgid "Returns Today" -msgstr "Devoluciones hoy" - -#. module: sale_rental_extension -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_order_group -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_orders -msgid "Orders" -msgstr "Pedidos" - -#. module: sale_rental_extension -#: model:ir.ui.menu,name:sale_rental_extension.menu_rental_today_pickup -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Pickup" -msgstr "Recogida" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_form_view -msgid "Qty" -msgstr "Ctd" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_action -msgid "Create a new rental order!" -msgstr "¡Crea una nueva orden de alquiler!" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Pickup:" -msgstr "Recogida:" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "Return:" -msgstr "Retorno:" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_view_kanban msgid "" msgstr "" -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_kanban -msgid "" -msgstr "" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_view_kanban msgid "" msgstr "" -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__is_late -msgid "Is Late" -msgstr "Atrasado" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__is_rental_order -msgid "Is Rental Order" -msgstr "Es pedido de alquiler" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_stock_picking__is_rental_picking -msgid "Is Rental Picking" -msgstr "Es albarán de alquiler" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__next_action_date -msgid "Next Action Date" -msgstr "Fecha próxima acción" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Order" -msgstr "Pedido" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__pickup_picking_id -msgid "Pickup Picking" -msgstr "Albarán de recogida" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_sale_order__return_picking_id -msgid "Return Picking" -msgstr "Albarán de retorno" - -#. module: sale_rental_extension -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_company__rental_require_signature_validation -#: model:ir.model.fields,field_description:sale_rental_extension.field_res_config_settings__rental_require_signature_validation -#: model:ir.model.fields,field_description:sale_rental_extension.field_stock_picking__rental_require_signature_validation -msgid "Rental Require Signature Validation" -msgstr "Requerir firma para validar alquiler" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "Require Signature to Validate Delivery" -msgstr "Requerir firma para validar la entrega" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.res_config_settings_view_form -msgid "When enabled, rental delivery orders can only be validated by signing. The Validate button is replaced by the Sign button." -msgstr "Si se activa, las entregas de alquiler solo se pueden validar con firma. El botón Validar se sustituye por el botón Firmar." - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.view_picking_form -msgid "Sign" -msgstr "Firmar" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Salesperson" -msgstr "Comercial" - -#. module: sale_rental_extension -#: model_terms:ir.ui.view,arch_db:sale_rental_extension.rental_order_view_search -msgid "Status" -msgstr "Estado" - #. module: sale_rental_extension #: model_terms:ir.ui.view,arch_db:sale_rental_extension.sale_rental_search msgid "Today" msgstr "Hoy" - - diff --git a/sale_rental_extension/models/__init__.py b/sale_rental_extension/models/__init__.py index ba1c090c8..8eb9d1d40 100644 --- a/sale_rental_extension/models/__init__.py +++ b/sale_rental_extension/models/__init__.py @@ -1,4 +1 @@ -from . import res_company -from . import res_config_settings -from . import sale_order -from . import stock_picking +from . import sale_order_line diff --git a/sale_rental_extension/models/sale_order_line.py b/sale_rental_extension/models/sale_order_line.py new file mode 100644 index 000000000..7c78ca173 --- /dev/null +++ b/sale_rental_extension/models/sale_order_line.py @@ -0,0 +1,87 @@ +# Copyright 2026 NuoBiT Solutions SL - Eric Antones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + rental_qty = fields.Float( + readonly=True, + states={ + "draft": [("readonly", False)], + "sent": [("readonly", False)], + "sale": [("readonly", False)], + }, + ) + + @api.onchange("product_id", "rental_qty") + def rental_product_id_change(self): + res = super().rental_product_id_change() + if ( + self.product_id.rented_product_id + and self.rental_type == "new_rental" + and not self.rental_qty + ): + self.rental_qty = 1 + return res + + def _action_launch_stock_rule(self, previous_product_uom_qty=False): + if self._context.get("skip_procurement"): + return True + return super()._action_launch_stock_rule( + previous_product_uom_qty=previous_product_uom_qty + ) + + def write(self, values): + if "rental_qty" in values: + rental_lines = self.filtered( + lambda l: l.state in ("sale", "done") + and l.rental_type == "new_rental" + and l.product_id.rented_product_id + ) + for line in rental_lines: + rental = self.env["sale.rental"].search( + [("start_order_line_id", "=", line.id)], limit=1 + ) + if rental and rental.out_move_id.state == "done": + raise UserError( + _( + "Cannot change rental quantity after pickup " + "for product '%s'.", + line.product_id.display_name, + ) + ) + else: + rental_lines = self.env["sale.order.line"] + + res = super().write(values) + + for line in rental_lines: + new_qty = line.rental_qty * line.number_of_days + if line.product_uom_qty != new_qty: + line.with_context(skip_procurement=True).write( + {"product_uom_qty": new_qty} + ) + rental = self.env["sale.rental"].search( + [("start_order_line_id", "=", line.id)], limit=1 + ) + if rental: + moves_to_update = self.env["stock.move"] + if rental.out_move_id and rental.out_move_id.state not in ( + "done", + "cancel", + ): + moves_to_update |= rental.out_move_id + if rental.in_move_id and rental.in_move_id.state not in ( + "done", + "cancel", + ): + moves_to_update |= rental.in_move_id + if moves_to_update: + moves_to_update.move_line_ids.write({"qty_done": 0}) + moves_to_update.write({"product_uom_qty": line.rental_qty}) + + return res diff --git a/sale_rental_extension/readme/DESCRIPTION.rst b/sale_rental_extension/readme/DESCRIPTION.rst index 898705bac..dc13bac79 100644 --- a/sale_rental_extension/readme/DESCRIPTION.rst +++ b/sale_rental_extension/readme/DESCRIPTION.rst @@ -2,7 +2,6 @@ This module extends ``sale_rental`` to improve the rental positions experience: * Kanban and calendar views for the Rental Positions screen * Searchpanel with state filter and "Today" filter -* Configurable signature terms for rental delivery orders - (Settings → Rental → Signature) -* Custom signature dialog with "Confirm & Sign" button on rental pickings +* Rental quantity defaults to 1 when adding a rental product +* Rental quantity can be edited on confirmed orders (before pickup) * Catalan and Spanish translations diff --git a/sale_rental_extension/static/description/index.html b/sale_rental_extension/static/description/index.html index d56aecd42..252ebcae1 100644 --- a/sale_rental_extension/static/description/index.html +++ b/sale_rental_extension/static/description/index.html @@ -379,9 +379,8 @@

Sale Rental Extension

  • Kanban and calendar views for the Rental Positions screen
  • Searchpanel with state filter and “Today” filter
  • -
  • Configurable signature terms for rental delivery orders -(Settings → Rental → Signature)
  • -
  • Custom signature dialog with “Confirm & Sign” button on rental pickings
  • +
  • Rental quantity defaults to 1 when adding a rental product
  • +
  • Rental quantity can be edited on confirmed orders (before pickup)
  • Catalan and Spanish translations