diff --git a/rma/README.rst b/rma/README.rst index abdfda0a..38fdff7e 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -51,6 +51,11 @@ If you want RMAs to be created from incoming emails, you need to: one. #. Go to 'Email' tab and set an 'Email Alias'. +If you want to manually finish RMAs, you need to: + +#. Go to *Settings > Inventory*. +#. Set *Finish RMAs manually* checkbox on. + Usage ===== @@ -79,6 +84,11 @@ To use this module, you need to: The RMA will be set automatically to 'Replaced' or 'Returned' state when the RMA quantity is equal or lower than the quantity in done delivery orders linked to it. +#. You can also finish the RMA without further ado. To do so click on the *Finish* + button. A wizard will ask you for the reason from a selection of preconfigured ones. + Be sure to configure them in advance on *RMA > Configuration > Finalization Reasons*. + Once the RMA is finished, it will be set to that state and the reason will be + registered. An RMA can also be created from a return of a delivery order: diff --git a/rma/__manifest__.py b/rma/__manifest__.py index 706ca39e..a8e37a69 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -10,7 +10,7 @@ "author": "Tecnativa, Odoo Community Association (OCA)", "maintainers": ["ernestotejeda"], "license": "AGPL-3", - "depends": ["stock_account"], + "depends": ["sale_stock"], "data": [ "views/report_rma.xml", "report/report.xml", @@ -21,9 +21,11 @@ "security/ir.model.access.csv", "wizard/stock_picking_return_views.xml", "wizard/rma_delivery_views.xml", + "wizard/rma_finalization_wizard_views.xml", "wizard/rma_split_views.xml", "views/menus.xml", "views/res_partner_views.xml", + "views/rma_finalization_views.xml", "views/rma_portal_templates.xml", "views/rma_team_views.xml", "views/rma_views.xml", diff --git a/rma/i18n/es.po b/rma/i18n/es.po index 01448cd2..77b8dfe2 100644 --- a/rma/i18n/es.po +++ b/rma/i18n/es.po @@ -6,28 +6,26 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-21 09:35+0000\n" -"PO-Revision-Date: 2022-01-21 10:49+0100\n" +"POT-Creation-Date: 2022-01-28 15:54+0000\n" +"PO-Revision-Date: 2022-01-28 15:54+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" +"Content-Transfer-Encoding: \n" "Plural-Forms: \n" -"X-Generator: Poedit 2.3\n" #. module: rma #: model:mail.template,report_name:rma.mail_template_rma_draft_notification #: model:mail.template,report_name:rma.mail_template_rma_notification #: model:mail.template,report_name:rma.mail_template_rma_receipt_notification msgid "${(object.name or '')}" -msgstr "${(object.name or '')}" +msgstr "" #. module: rma #: model:mail.template,subject:rma.mail_template_rma_notification msgid "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" -msgstr "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" +msgstr "" #. module: rma #: model:mail.template,subject:rma.mail_template_rma_receipt_notification @@ -71,8 +69,7 @@ msgid "" " (${object.partner_id.parent_id.name})\n" " % endif\n" "

\n" -" Here is the RMA ${object.name} from ${object.company_id." -"name}.\n" +" Here is the RMA ${object.name} from ${object.company_id.name}.\n" "

\n" " Do not hesitate to contact us if you have any question.\n" "

\n" @@ -86,8 +83,7 @@ msgstr "" " (${object.partner_id.parent_id.name})\n" " % endif\n" "

\n" -" Aquí tiene el RMA ${object.name} Desde ${object." -"company_id.name}.\n" +" Aquí tiene el RMA ${object.name} Desde ${object.company_id.name}.\n" "

\n" " No dude en ponerse en contacto con nosotros si tiene alguna pregunta.\n" "

\n" @@ -164,12 +160,10 @@ msgstr "" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page -msgid "" -"" +msgid "" msgstr "" -"" +"" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page @@ -188,20 +182,20 @@ msgstr "Esperando Pago" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page msgid "" -"" +"" msgstr "" -"" +"" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page msgid "" -"" +"" msgstr "" -"" +"" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page @@ -373,8 +367,8 @@ msgid "" "A Python dictionary that will be evaluated to provide default values when " "creating new records for this alias." msgstr "" -"Diccionario Python a evaluar para proporcionar valores por defecto cuando un " -"nuevo registro se cree para este seudónimo." +"Diccionario Python a evaluar para proporcionar valores por defecto cuando un" +" nuevo registro se cree para este seudónimo." #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_team_view_form @@ -393,9 +387,11 @@ msgid "Action Needed" msgstr "Acción Necesaria" #. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization__active #: model:ir.model.fields,field_description:rma.field_rma_operation__active #: model:ir.model.fields,field_description:rma.field_rma_tag__active #: model:ir.model.fields,field_description:rma.field_rma_team__active +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search #: model_terms:ir.ui.view,arch_db:rma.rma_tag_view_search msgid "Active" msgstr "Activo" @@ -441,7 +437,9 @@ msgid "Aliased Model" msgstr "Modelo con seudónimo" #. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search #: model_terms:ir.ui.view,arch_db:rma.rma_tag_view_search +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_form msgid "Archived" msgstr "Archivado" @@ -459,7 +457,12 @@ msgstr "Conteo de archivos adjuntos" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_team_view_form msgid "Avatar" -msgstr "Avatar" +msgstr "" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma__can_be_finished +msgid "Can Be Finished" +msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__can_be_locked @@ -487,6 +490,7 @@ msgid "Can Be Split" msgstr "Puede ser dividido" #. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_wizard_view_form #: model_terms:ir.ui.view,arch_db:rma.rma_redelivery_wizard_view_form #: model_terms:ir.ui.view,arch_db:rma.rma_split_wizard_view_form2 #: model_terms:ir.ui.view,arch_db:rma.rma_view_form @@ -526,6 +530,7 @@ msgstr "Compañías" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__company_id +#: model:ir.model.fields,field_description:rma.field_rma_finalization__company_id #: model:ir.model.fields,field_description:rma.field_rma_team__company_id msgid "Company" msgstr "Compañía" @@ -562,6 +567,11 @@ msgstr "Contacto" msgid "Create RMAs" msgstr "Crear RMAs" +#. module: rma +#: model_terms:ir.actions.act_window,help:rma.action_rma_finalization +msgid "Create a new RMA finalization" +msgstr "Crear un nuevo motivo de finalización de RMA" + #. module: rma #: model_terms:ir.actions.act_window,help:rma.action_rma_tag msgid "Create a new RMA tag" @@ -570,6 +580,8 @@ msgstr "Crear una nueva etiqueta de RMA" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__create_uid #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__create_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization__create_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__create_uid #: model:ir.model.fields,field_description:rma.field_rma_operation__create_uid #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__create_uid #: model:ir.model.fields,field_description:rma.field_rma_tag__create_uid @@ -580,6 +592,8 @@ msgstr "Creado por" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__create_date #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__create_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization__create_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__create_date #: model:ir.model.fields,field_description:rma.field_rma_operation__create_date #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__create_date #: model:ir.model.fields,field_description:rma.field_rma_tag__create_date @@ -663,6 +677,8 @@ msgstr "Descripción" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__display_name #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__display_name +#: model:ir.model.fields,field_description:rma.field_rma_finalization__display_name +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__display_name #: model:ir.model.fields,field_description:rma.field_rma_operation__display_name #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__display_name #: model:ir.model.fields,field_description:rma.field_rma_tag__display_name @@ -725,7 +741,8 @@ msgstr "Enviar correo al cliente una vez se confirma el RMA." #: model:ir.model.fields,help:rma.field_res_company__rma_mail_receipt_confirmation_template_id #: model:ir.model.fields,help:rma.field_res_config_settings__rma_mail_receipt_confirmation_template_id msgid "Email sent to the customer once the RMA products are received." -msgstr "Enviar correo al cliente una vez se recepcionen los productos del RMA." +msgstr "" +"Enviar correo al cliente una vez se recepcionen los productos del RMA." #. module: rma #: model:ir.model.fields,help:rma.field_res_company__rma_mail_draft_confirmation_template_id @@ -746,6 +763,36 @@ msgstr "RMA Extraído" msgid "Extracted from" msgstr "Extraído de" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma__finalization_id +msgid "Finalization Reason" +msgstr "Motivo de finalización" + +#. module: rma +#: model:ir.model.constraint,message:rma.constraint_rma_finalization_name_company_uniq +msgid "Finalization name already exists !" +msgstr "¡El nombre de finalización ya existe!" + +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_view_form +msgid "Finish" +msgstr "Finalizar" + +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_wizard_view_form +msgid "Finish RMA" +msgstr "Finalizar RMA" + +#. module: rma +#: model:ir.actions.act_window,name:rma.rma_finalization_wizard_action +msgid "Finish RMA Manualy" +msgstr "Finalizar RMA manualmente" + +#. module: rma +#: model:ir.model.fields.selection,name:rma.selection__rma__state__finished +msgid "Finished" +msgstr "Finalizado" + #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__message_follower_ids #: model:ir.model.fields,field_description:rma.field_rma_team__message_follower_ids @@ -772,18 +819,20 @@ msgstr "Agrupar por" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__id #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__id +#: model:ir.model.fields,field_description:rma.field_rma_finalization__id +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__id #: model:ir.model.fields,field_description:rma.field_rma_operation__id #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__id #: model:ir.model.fields,field_description:rma.field_rma_tag__id #: model:ir.model.fields,field_description:rma.field_rma_team__id msgid "ID" -msgstr "ID" +msgstr "" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_parent_thread_id msgid "" -"ID of the parent record holding the alias (example: project holding the task " -"creation alias)" +"ID of the parent record holding the alias (example: project holding the task" +" creation alias)" msgstr "" "ID del registro padre que tiene el seudónimo. (ejemplo: el proyecto que " "contiene el seudónimo para la creación de tareas)" @@ -863,6 +912,8 @@ msgstr "Apunte contable" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma____last_update #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard____last_update +#: model:ir.model.fields,field_description:rma.field_rma_finalization____last_update +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard____last_update #: model:ir.model.fields,field_description:rma.field_rma_operation____last_update #: model:ir.model.fields,field_description:rma.field_rma_split_wizard____last_update #: model:ir.model.fields,field_description:rma.field_rma_tag____last_update @@ -873,6 +924,8 @@ msgstr "Última modificación en" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__write_uid #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__write_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization__write_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__write_uid #: model:ir.model.fields,field_description:rma.field_rma_operation__write_uid #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__write_uid #: model:ir.model.fields,field_description:rma.field_rma_tag__write_uid @@ -883,6 +936,8 @@ msgstr "Última actualización por" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__write_date #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__write_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization__write_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__write_date #: model:ir.model.fields,field_description:rma.field_rma_operation__write_date #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__write_date #: model:ir.model.fields,field_description:rma.field_rma_tag__write_date @@ -916,6 +971,14 @@ msgstr "Bloqueado" msgid "Main Attachment" msgstr "Adjuntos principales" +#. module: rma +#: model_terms:ir.actions.act_window,help:rma.action_rma_finalization +msgid "" +"Manage RMA finalization reasons to better classify them for tracking and " +"analysis purposes." +msgstr "Adminitrar motivos de finalización de RMA para una mejor clasificación de estos" +" para su seguimiento análisis posterior." + #. module: rma #: model_terms:ir.actions.act_window,help:rma.action_rma_tag msgid "" @@ -956,6 +1019,7 @@ msgid "Name" msgstr "Nombre" #. module: rma +#: code:addons/rma/models/rma.py:0 code:addons/rma/models/rma.py:0 #: code:addons/rma/models/rma.py:0 #, python-format msgid "New" @@ -991,7 +1055,7 @@ msgstr "Ninguno de los RMAs seleccionados puede realizar una devolución." #. module: rma #: model:ir.model.fields.selection,name:rma.selection__rma__priority__1 msgid "Normal" -msgstr "Normal" +msgstr "" #. module: rma #: model:ir.model.fields.selection,name:rma.selection__rma__priority__0 @@ -1035,8 +1099,8 @@ msgid "" "attached, even if they did not reply to it. If set, this will disable the " "creation of new records completely." msgstr "" -"Id. opcional de un hilo (registro) al que todos los mensajes entrantes serán " -"adjuntados, incluso si no fueron respuestas del mismo. Si se establece, se " +"Id. opcional de un hilo (registro) al que todos los mensajes entrantes serán" +" adjuntados, incluso si no fueron respuestas del mismo. Si se establece, se " "deshabilitará completamente la creación de nuevos registros." #. module: rma @@ -1077,8 +1141,8 @@ msgstr "ID del hilo del registro padre" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_parent_model_id msgid "" -"Parent model holding the alias. The model holding the alias reference is not " -"necessarily the model given by alias_model_id (example: project " +"Parent model holding the alias. The model holding the alias reference is not" +" necessarily the model given by alias_model_id (example: project " "(parent_model) and task (model))" msgstr "" "Modelo padre que contiene el alias. El modelo que contiene la referencia " @@ -1095,15 +1159,12 @@ msgid "" "Policy to post a message on the document using the mailgateway.\n" "- everyone: everyone can post\n" "- partners: only authenticated partners\n" -"- followers: only followers of the related document or members of following " -"channels\n" +"- followers: only followers of the related document or members of following channels\n" msgstr "" -"Política para publicar un mensaje en el documento utilizando el servidor de " -"correo.\n" +"Política para publicar un mensaje en el documento utilizando el servidor de correo.\n" "- todo el mundo: todos pueden publicar\n" "- socios: sólo socios autenticados\n" -"- seguidores: sólo seguidores del documento relacionado o miembros de los " -"siguientes canales\n" +"- seguidores: sólo seguidores del documento relacionado o miembros de los siguientes canales\n" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__access_url @@ -1185,7 +1246,7 @@ msgstr "Cantidad a extraer en nuevo RMA." #: model_terms:ir.ui.view,arch_db:rma.view_partner_form #: model_terms:ir.ui.view,arch_db:rma.view_picking_form msgid "RMA" -msgstr "RMA" +msgstr "" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_my_rmas @@ -1225,6 +1286,29 @@ msgstr "Órdenes de entrega de RMA" msgid "RMA Delivery Wizard" msgstr "Asistente de entrega de RMA" +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_form +msgid "RMA Finalization" +msgstr "Finalización de RMA" + +#. module: rma +#: model:ir.model,name:rma.model_rma_finalization +msgid "RMA Finalization Reason" +msgstr "Motivo de finalización de RMA" + +#. module: rma +#: model:ir.actions.act_window,name:rma.action_rma_finalization +#: model:ir.ui.menu,name:rma.rma_configuration_rma_finalization_menu +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_list +msgid "RMA Finalization Reasons" +msgstr "Motivos de finalización de RMA" + +#. module: rma +#: model:ir.model,name:rma.model_rma_finalization_wizard +msgid "RMA Finalization Wizard" +msgstr "Asistente de finalización de RMA" + #. module: rma #: model:ir.model.fields,field_description:rma.field_stock_warehouse__rma_in_type_id msgid "RMA In Type" @@ -1360,7 +1444,7 @@ msgstr "Equipo de RMA" #: model:ir.model.fields,field_description:rma.field_res_users__rma_ids #: model:ir.model.fields,field_description:rma.field_stock_move__rma_ids msgid "RMAs" -msgstr "RMAs" +msgstr "" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_view_search @@ -1372,6 +1456,16 @@ msgstr "RMAs pasados de fecha límite" msgid "RMAs yet to be fully processed" msgstr "RMAs pendientes de ser procesados por completo" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__finalization_id +msgid "Reason" +msgstr "Motivo" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization__name +msgid "Reason Name" +msgstr "Nombre del motivo" + #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_view_form msgid "Receipt" @@ -1458,13 +1552,13 @@ msgstr "Reemplazado" #: code:addons/rma/models/rma.py:0 #, python-format msgid "" -"Replacement: Move %s (Picking %s) has been created." +"Replacement: Move %s (Picking %s) has been created." msgstr "" "Reemplazo: El movimiento %s (Orden de entrega %s) ha sido creado." +"id=\"%d\">%s (Orden de entrega %s) ha sido creado." #. module: rma #: code:addons/rma/models/rma.py:0 @@ -1475,10 +1569,10 @@ msgid "" "create a new move, but one of the previously created moves was updated with " "this data." msgstr "" -"Reemplazo:
Producto %s
Cantidad %f %s
El reemplazo realizado no creó un " -"movimiento nuevo, pero uno de los movimientos creados anteriormente fué " -"actualizado con estos datos." +"Reemplazo:
Producto %s
Cantidad %f %s
El reemplazo realizado no " +"creó un movimiento nuevo, pero uno de los movimientos creados anteriormente " +"fué actualizado con estos datos." #. module: rma #: model:ir.ui.menu,name:rma.rma_reporting_menu @@ -1523,11 +1617,11 @@ msgstr "Devolver al cliente" #: code:addons/rma/models/rma.py:0 #, python-format msgid "" -"Return: %s has been created." +"Return: %s has been created." msgstr "" -"Devolución: La orden de entrega %s ha sido creada." +"Devolución: La orden de entrega %s ha sido creada." #. module: rma #: model:ir.model.fields.selection,name:rma.selection__rma__state__returned @@ -1537,7 +1631,7 @@ msgstr "Devuelto" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma_tag__rma_ids msgid "Rma" -msgstr "Rma" +msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__rma_count @@ -1665,11 +1759,11 @@ msgstr "Dividir RMA" #: code:addons/rma/models/rma.py:0 #, python-format msgid "" -"Split: %s has been " -"created." +"Split: %s has been" +" created." msgstr "" -"División: El RMA %s ha sido creado." +"División: El RMA %s ha sido creado." #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__state @@ -1751,9 +1845,9 @@ msgstr "" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_model_id msgid "" -"The model (Odoo Document Kind) to which this alias corresponds. Any incoming " -"email that does not reply to an existing record will cause the creation of a " -"new record of this model (e.g. a Project Task)" +"The model (Odoo Document Kind) to which this alias corresponds. Any incoming" +" email that does not reply to an existing record will cause the creation of " +"a new record of this model (e.g. a Project Task)" msgstr "" "El modelo (Tipo de documento de Odoo) al que corresponde este seudónimo. " "Cualquier correo entrante que no sea respuesta a un registro existente, " @@ -1765,8 +1859,9 @@ msgid "" "The name of the email alias, e.g. 'jobs' if you want to catch emails for " "" msgstr "" -"El nombre de este seudónimo de correo electrónico. Por ejemplo, \"trabajos" -"\", si lo que quiere es obtener los correos para " +"El nombre de este seudónimo de correo electrónico. Por ejemplo, " +"\"trabajos\", si lo que quiere es obtener los correos para " +"" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_user_id @@ -1807,8 +1902,8 @@ msgstr "La etiqueta es visible en la vista de portal" #: code:addons/rma/models/account_move.py:0 #, python-format msgid "" -"There is at least one invoice lines whose quantity is less than the quantity " -"specified in its linked RMA." +"There is at least one invoice lines whose quantity is less than the quantity" +" specified in its linked RMA." msgstr "" "Hay al menos una linea de factura que tiene una cantidad menor que la " "cantidad especificada en el RMA asociado." @@ -1977,7 +2072,8 @@ msgstr "" #: model:ir.model.fields,help:rma.field_res_company__send_rma_receipt_confirmation #: model:ir.model.fields,help:rma.field_res_config_settings__send_rma_receipt_confirmation msgid "" -"When the RMA receipt is confirmed, send a confirmation email to the customer." +"When the RMA receipt is confirmed, send a confirmation email to the " +"customer." msgstr "" #. module: rma diff --git a/rma/i18n/rma.pot b/rma/i18n/rma.pot index 16a3cfd3..37c9bc60 100644 --- a/rma/i18n/rma.pot +++ b/rma/i18n/rma.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-01-28 15:54+0000\n" +"PO-Revision-Date: 2022-01-28 15:54+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -321,9 +323,11 @@ msgid "Action Needed" msgstr "" #. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization__active #: model:ir.model.fields,field_description:rma.field_rma_operation__active #: model:ir.model.fields,field_description:rma.field_rma_tag__active #: model:ir.model.fields,field_description:rma.field_rma_team__active +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search #: model_terms:ir.ui.view,arch_db:rma.rma_tag_view_search msgid "Active" msgstr "" @@ -369,7 +373,9 @@ msgid "Aliased Model" msgstr "" #. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search #: model_terms:ir.ui.view,arch_db:rma.rma_tag_view_search +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_form msgid "Archived" msgstr "" @@ -389,6 +395,11 @@ msgstr "" msgid "Avatar" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma__can_be_finished +msgid "Can Be Finished" +msgstr "" + #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__can_be_locked msgid "Can Be Locked" @@ -415,6 +426,7 @@ msgid "Can Be Split" msgstr "" #. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_wizard_view_form #: model_terms:ir.ui.view,arch_db:rma.rma_redelivery_wizard_view_form #: model_terms:ir.ui.view,arch_db:rma.rma_split_wizard_view_form2 #: model_terms:ir.ui.view,arch_db:rma.rma_view_form @@ -454,6 +466,7 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__company_id +#: model:ir.model.fields,field_description:rma.field_rma_finalization__company_id #: model:ir.model.fields,field_description:rma.field_rma_team__company_id msgid "Company" msgstr "" @@ -490,6 +503,11 @@ msgstr "" msgid "Create RMAs" msgstr "" +#. module: rma +#: model_terms:ir.actions.act_window,help:rma.action_rma_finalization +msgid "Create a new RMA finalization" +msgstr "" + #. module: rma #: model_terms:ir.actions.act_window,help:rma.action_rma_tag msgid "Create a new RMA tag" @@ -498,6 +516,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__create_uid #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__create_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization__create_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__create_uid #: model:ir.model.fields,field_description:rma.field_rma_operation__create_uid #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__create_uid #: model:ir.model.fields,field_description:rma.field_rma_tag__create_uid @@ -508,6 +528,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__create_date #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__create_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization__create_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__create_date #: model:ir.model.fields,field_description:rma.field_rma_operation__create_date #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__create_date #: model:ir.model.fields,field_description:rma.field_rma_tag__create_date @@ -591,6 +613,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__display_name #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__display_name +#: model:ir.model.fields,field_description:rma.field_rma_finalization__display_name +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__display_name #: model:ir.model.fields,field_description:rma.field_rma_operation__display_name #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__display_name #: model:ir.model.fields,field_description:rma.field_rma_tag__display_name @@ -672,6 +696,36 @@ msgstr "" msgid "Extracted from" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma__finalization_id +msgid "Finalization Reason" +msgstr "" + +#. module: rma +#: model:ir.model.constraint,message:rma.constraint_rma_finalization_name_company_uniq +msgid "Finalization name already exists !" +msgstr "" + +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_view_form +msgid "Finish" +msgstr "" + +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_wizard_view_form +msgid "Finish RMA" +msgstr "" + +#. module: rma +#: model:ir.actions.act_window,name:rma.rma_finalization_wizard_action +msgid "Finish RMA Manualy" +msgstr "" + +#. module: rma +#: model:ir.model.fields.selection,name:rma.selection__rma__state__finished +msgid "Finished" +msgstr "" + #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__message_follower_ids #: model:ir.model.fields,field_description:rma.field_rma_team__message_follower_ids @@ -698,6 +752,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__id #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__id +#: model:ir.model.fields,field_description:rma.field_rma_finalization__id +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__id #: model:ir.model.fields,field_description:rma.field_rma_operation__id #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__id #: model:ir.model.fields,field_description:rma.field_rma_tag__id @@ -785,6 +841,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma____last_update #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard____last_update +#: model:ir.model.fields,field_description:rma.field_rma_finalization____last_update +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard____last_update #: model:ir.model.fields,field_description:rma.field_rma_operation____last_update #: model:ir.model.fields,field_description:rma.field_rma_split_wizard____last_update #: model:ir.model.fields,field_description:rma.field_rma_tag____last_update @@ -795,6 +853,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__write_uid #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__write_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization__write_uid +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__write_uid #: model:ir.model.fields,field_description:rma.field_rma_operation__write_uid #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__write_uid #: model:ir.model.fields,field_description:rma.field_rma_tag__write_uid @@ -805,6 +865,8 @@ msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__write_date #: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__write_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization__write_date +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__write_date #: model:ir.model.fields,field_description:rma.field_rma_operation__write_date #: model:ir.model.fields,field_description:rma.field_rma_split_wizard__write_date #: model:ir.model.fields,field_description:rma.field_rma_tag__write_date @@ -838,6 +900,13 @@ msgstr "" msgid "Main Attachment" msgstr "" +#. module: rma +#: model_terms:ir.actions.act_window,help:rma.action_rma_finalization +msgid "" +"Manage RMA finalization reasons to better classify them for tracking and " +"analysis purposes." +msgstr "" + #. module: rma #: model_terms:ir.actions.act_window,help:rma.action_rma_tag msgid "" @@ -1132,6 +1201,29 @@ msgstr "" msgid "RMA Delivery Wizard" msgstr "" +#. module: rma +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_form +msgid "RMA Finalization" +msgstr "" + +#. module: rma +#: model:ir.model,name:rma.model_rma_finalization +msgid "RMA Finalization Reason" +msgstr "" + +#. module: rma +#: model:ir.actions.act_window,name:rma.action_rma_finalization +#: model:ir.ui.menu,name:rma.rma_configuration_rma_finalization_menu +#: model_terms:ir.ui.view,arch_db:rma.rma_finalization_view_search +#: model_terms:ir.ui.view,arch_db:rma.view_rma_finalization_list +msgid "RMA Finalization Reasons" +msgstr "" + +#. module: rma +#: model:ir.model,name:rma.model_rma_finalization_wizard +msgid "RMA Finalization Wizard" +msgstr "" + #. module: rma #: model:ir.model.fields,field_description:rma.field_stock_warehouse__rma_in_type_id msgid "RMA In Type" @@ -1278,6 +1370,16 @@ msgstr "" msgid "RMAs yet to be fully processed" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization_wizard__finalization_id +msgid "Reason" +msgstr "" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_finalization__name +msgid "Reason Name" +msgstr "" + #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_view_form msgid "Receipt" diff --git a/rma/models/__init__.py b/rma/models/__init__.py index cc210923..0436117f 100644 --- a/rma/models/__init__.py +++ b/rma/models/__init__.py @@ -2,6 +2,7 @@ from . import account_move from . import rma +from . import rma_finalization from . import rma_operation from . import rma_tag from . import rma_team diff --git a/rma/models/res_config_settings.py b/rma/models/res_config_settings.py index 751656bb..a74f8c1c 100644 --- a/rma/models/res_config_settings.py +++ b/rma/models/res_config_settings.py @@ -6,6 +6,11 @@ from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" + group_rma_manual_finalization = fields.Boolean( + string="Finish RMA manually choosing a reason", + help="Allow to finish an RMA without returning back a product or refunding", + implied_group="rma.group_rma_manual_finalization", + ) send_rma_confirmation = fields.Boolean( related="company_id.send_rma_confirmation", readonly=False, ) diff --git a/rma/models/rma.py b/rma/models/rma.py index 55495a71..0d7f61d6 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -60,6 +60,14 @@ class Rma(models.Model): states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]}, ) tag_ids = fields.Many2many(comodel_name="rma.tag", string="Tags") + finalization_id = fields.Many2one( + string="Finalization Reason", + comodel_name="rma.finalization", + copy=False, + readonly=True, + domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", + tracking=True, + ) company_id = fields.Many2one( comodel_name="res.company", default=lambda self: self.env.company, @@ -161,6 +169,7 @@ class Rma(models.Model): ("refunded", "Refunded"), ("returned", "Returned"), ("replaced", "Replaced"), + ("finished", "Finished"), ("locked", "Locked"), ("cancelled", "Canceled"), ], @@ -221,6 +230,7 @@ class Rma(models.Model): can_be_returned = fields.Boolean(compute="_compute_can_be_returned",) can_be_replaced = fields.Boolean(compute="_compute_can_be_replaced",) can_be_locked = fields.Boolean(compute="_compute_can_be_locked",) + can_be_finished = fields.Boolean(compute="_compute_can_be_finished",) remaining_qty = fields.Float( string="Remaining delivered qty", digits="Product Unit of Measure", @@ -354,6 +364,14 @@ class Rma(models.Model): "replaced", ] + @api.depends("state", "remaining_qty") + def _compute_can_be_finished(self): + for rma in self: + rma.can_be_finished = ( + rma.state in {"received", "waiting_replacement", "waiting_return"} + and rma.remaining_qty > 0 + ) + @api.depends("product_uom_qty", "state", "remaining_qty", "remaining_qty_to_done") def _compute_can_be_split(self): """ Compute 'can_be_split'. This field controls the @@ -686,6 +704,21 @@ class Rma(models.Model): action["context"].update(active_id=self.id, active_ids=self.ids) return action + def action_finish(self): + """Invoked when a user wants to manually finalize the RMA""" + self.ensure_one() + self._ensure_can_be_returned() + # Force active_id to avoid issues when coming from smart buttons + # in other models + action = ( + self.env.ref("rma.rma_finalization_wizard_action") + .with_context(active_id=self.id) + .read()[0] + ) + action["context"] = dict(self.env.context) + action["context"].update(active_id=self.id, active_ids=self.ids) + return action + def action_cancel(self): """Invoked when 'Cancel' button in rma form view is clicked.""" self.mapped("reception_move_id")._action_cancel() diff --git a/rma/models/rma_finalization.py b/rma/models/rma_finalization.py new file mode 100644 index 00000000..2d2e4464 --- /dev/null +++ b/rma/models/rma_finalization.py @@ -0,0 +1,21 @@ +# Copyright 2022 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class RmaFinalization(models.Model): + _description = "RMA Finalization Reason" + _name = "rma.finalization" + _order = "name" + + active = fields.Boolean(default=True) + name = fields.Char(string="Reason Name", required=True, translate=True, copy=False,) + company_id = fields.Many2one(comodel_name="res.company") + + _sql_constraints = [ + ( + "name_company_uniq", + "unique (name, company_id)", + "Finalization name already exists !", + ), + ] diff --git a/rma/readme/CONFIGURE.rst b/rma/readme/CONFIGURE.rst index c5513046..94121f64 100644 --- a/rma/readme/CONFIGURE.rst +++ b/rma/readme/CONFIGURE.rst @@ -6,3 +6,8 @@ If you want RMAs to be created from incoming emails, you need to: #. Go to *RMA > Configuration > RMA Team* and select a team or create a new one. #. Go to 'Email' tab and set an 'Email Alias'. + +If you want to manually finish RMAs, you need to: + +#. Go to *Settings > Inventory*. +#. Set *Finish RMAs manually* checkbox on. diff --git a/rma/readme/USAGE.rst b/rma/readme/USAGE.rst index aa524e7a..1381ebc4 100644 --- a/rma/readme/USAGE.rst +++ b/rma/readme/USAGE.rst @@ -23,6 +23,11 @@ To use this module, you need to: The RMA will be set automatically to 'Replaced' or 'Returned' state when the RMA quantity is equal or lower than the quantity in done delivery orders linked to it. +#. You can also finish the RMA without further ado. To do so click on the *Finish* + button. A wizard will ask you for the reason from a selection of preconfigured ones. + Be sure to configure them in advance on *RMA > Configuration > Finalization Reasons*. + Once the RMA is finished, it will be set to that state and the reason will be + registered. An RMA can also be created from a return of a delivery order: diff --git a/rma/security/ir.model.access.csv b/rma/security/ir.model.access.csv index ad209dc7..d794f418 100644 --- a/rma/security/ir.model.access.csv +++ b/rma/security/ir.model.access.csv @@ -8,3 +8,6 @@ access_rma_operation_user_own,rma.operation.user.own,model_rma_operation,rma_gro access_rma_operation_manager,rma.operation.manager,model_rma_operation,rma_group_manager,1,1,1,1 access_rma_tag_user_own,rma.tag.user.own,model_rma_tag,rma_group_user_own,1,0,0,0 access_rma_tag_manager,rma.tag.manager,model_rma_tag,rma_group_manager,1,1,1,1 +access_rma_finalization_portal,rma.finalization.portal,model_rma_finalization,base.group_portal,1,0,0,0 +access_rma_finalization_user_own,rma.finalization.user.own,model_rma_finalization,rma_group_user_own,1,0,0,0 +access_rma_finalization_manager,rma.finalization.manager,model_rma_finalization,rma_group_manager,1,1,1,1 diff --git a/rma/security/rma_security.xml b/rma/security/rma_security.xml index e7c42289..f9c3ad48 100644 --- a/rma/security/rma_security.xml +++ b/rma/security/rma_security.xml @@ -38,6 +38,10 @@ eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]" /> + + Allow RMA manual finalization + + Personal RMAs @@ -79,6 +83,14 @@ name="domain_force" >['|',('company_id','=',False),('company_id','in',company_ids)] + + RMA Finalization Reason multi-company + + + ['|', ('company_id', 'in', company_ids), ('company_id', '=', False)] + diff --git a/rma/static/description/index.html b/rma/static/description/index.html index f99fdcde..3bce9cd5 100644 --- a/rma/static/description/index.html +++ b/rma/static/description/index.html @@ -3,7 +3,7 @@ - + Return Merchandise Authorization Management