diff --git a/rma_sale/README.rst b/rma_sale/README.rst new file mode 100644 index 00000000..43111230 --- /dev/null +++ b/rma_sale/README.rst @@ -0,0 +1,126 @@ +============================================================= +Return Merchandise Authorization Management - Link with Sales +============================================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github + :target: https://github.com/OCA/rma/tree/13.0/rma_sale + :alt: OCA/rma +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/rma-13-0/rma-13-0-rma_sale + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/145/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to link a sales order to an RMA. +This can be done by creating an RMA from scratch and selecting the sales +order, creating one or more RMAs from a sales order form view or from a sales +order web portal page. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Go to *RMA > Orders* and create a new RMA. +#. Select a sales order to be linked to the RMA if you want. +#. Now you can do the rest of the instructions described in the + *readme* of the rma module. + +If you want to create one or more RMAs from a sale order: + +#. Go to *Sales > Orders > Orders*. +#. Create a new sales order or select an existing one. +#. If the sales order is in 'Sales Order' state you can see in the status bar + a button labeled 'Create RMA', click it and a wizard will appear. +#. Modify the data at your convenience and click on 'Accept' button. +#. As many RMAs as lines with quantity greater than zero will be created. + Those RMAs will be linked to the sales order. + +The customer can also create RMAs from a sales order portal page: + +#. Go to a confirmed sales order portal page. +#. In the left sidebar you can see a button named 'Request RMAs'. +#. By clicking on this button a popup will appear to allow you to define + the quantity per product and delivery order line. +#. Click on the 'Request RMAs' button and RMAs will be created linked to + the sales order. + +Known issues / Roadmap +====================== + +* When you try to request an RMA from a Sales Order in the portal, + a popup appears and the inputs for the quantity doesn't allow + decimal numbers. It would be good to have a component that allows + that and at the same time keeps the constraint of not allowing a + number greater than the order line product quantity. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Ernesto Tejeda + * Pedro M. Baeza + * David Vidal + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-ernestotejeda| image:: https://github.com/ernestotejeda.png?size=40px + :target: https://github.com/ernestotejeda + :alt: ernestotejeda + +Current `maintainer `__: + +|maintainer-ernestotejeda| + +This module is part of the `OCA/rma `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/rma_sale/__init__.py b/rma_sale/__init__.py new file mode 100644 index 00000000..57055b3c --- /dev/null +++ b/rma_sale/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import controllers +from . import models +from . import wizard diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py new file mode 100644 index 00000000..c63d3bdb --- /dev/null +++ b/rma_sale/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Return Merchandise Authorization Management - Link with Sales", + "summary": "Sale Order - Return Merchandise Authorization (RMA)", + "version": "13.0.1.0.0", + "development_status": "Production/Stable", + "category": "RMA", + "website": "https://github.com/OCA/rma", + "author": "Tecnativa, Odoo Community Association (OCA)", + "maintainers": ["ernestotejeda"], + "license": "AGPL-3", + "depends": ["rma", "sale_stock"], + "data": [ + "views/assets.xml", + "views/report_rma.xml", + "views/rma_views.xml", + "views/sale_views.xml", + "views/sale_portal_template.xml", + "wizard/sale_order_rma_wizard_views.xml", + ], +} diff --git a/rma_sale/controllers/__init__.py b/rma_sale/controllers/__init__.py new file mode 100644 index 00000000..c3c3eb4d --- /dev/null +++ b/rma_sale/controllers/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import rma_portal +from . import sale_portal diff --git a/rma_sale/controllers/rma_portal.py b/rma_sale/controllers/rma_portal.py new file mode 100644 index 00000000..c4e58156 --- /dev/null +++ b/rma_sale/controllers/rma_portal.py @@ -0,0 +1,12 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.addons.rma.controllers.main import PortalRma + + +class PortalRma(PortalRma): + def _get_filter_domain(self, kw): + res = super()._get_filter_domain(kw) + if "sale_id" in kw: + res.append(("order_id", "=", int(kw["sale_id"]))) + return res diff --git a/rma_sale/controllers/sale_portal.py b/rma_sale/controllers/sale_portal.py new file mode 100644 index 00000000..70403a80 --- /dev/null +++ b/rma_sale/controllers/sale_portal.py @@ -0,0 +1,53 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, http +from odoo.exceptions import AccessError, MissingError +from odoo.http import request + +from odoo.addons.sale.controllers.portal import CustomerPortal + + +class CustomerPortal(CustomerPortal): + @http.route( + ["/my/orders//requestrma"], + type="http", + auth="public", + methods=["POST"], + website=True, + ) + def request_rma(self, order_id, access_token=None, **post): + try: + order_sudo = self._document_check_access( + "sale.order", order_id, access_token=access_token + ) + except (AccessError, MissingError): + return request.redirect("/my") + order_obj = request.env["sale.order"] + wizard_obj = request.env["sale.order.rma.wizard"] + # Set wizard line vals + mapped_vals = {} + for name, value in post.items(): + row, field_name = name.split("-", 1) + mapped_vals.setdefault(row, {}).update({field_name: value}) + # If no operation is filled, no RMA will be created + line_vals = [ + (0, 0, vals) for vals in mapped_vals.values() if vals.get("operation_id") + ] + # Create wizard an generate rmas + order = order_obj.browse(order_id).sudo() + location_id = order.warehouse_id.rma_loc_id.id + wizard = wizard_obj.with_context(active_id=order_id).create( + {"line_ids": line_vals, "location_id": location_id} + ) + rma = wizard.sudo().create_rma() + for rec in rma: + rec.origin += _(" (Portal)") + # Add the user as follower of the created RMAs so they can + # later view them. + rma.message_subscribe([request.env.user.partner_id.id]) + if len(rma) == 0: + route = order_sudo.get_portal_url() + else: + route = "/my/rmas?sale_id=%d" % order_id + return request.redirect(route) diff --git a/rma_sale/i18n/es.po b/rma_sale/i18n/es.po new file mode 100644 index 00000000..53f318d3 --- /dev/null +++ b/rma_sale/i18n/es.po @@ -0,0 +1,402 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * rma_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-07-01 04:40+0000\n" +"PO-Revision-Date: 2020-10-06 14:16+0000\n" +"Last-Translator: David Vidal \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: rma_sale +#: code:addons/rma_sale/controllers/sale_portal.py:39 +#, python-format +msgid " (Portal)" +msgstr " (Portal)" + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42 +#, python-format +msgid " has been created." +msgstr " ha sido creado." + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44 +#, python-format +msgid " have been created." +msgstr " han sido creados." + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "&times;" +msgstr "&times;" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr " Solicitar RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr " Solicitar RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Cancel" +msgstr " Cancelar" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "" +"" +msgstr "" +"" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "RMA" +msgstr "RMA" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Requested operation:" +msgstr "Operación solicitada:" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Requested operation" +msgstr "Operación solicitada:" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Sale order:" +msgstr "Orden de venta:" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Sale order" +msgstr "Orden de venta" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Accept" +msgstr "Aceptar" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_move_ids +msgid "Allowed Move" +msgstr "Movimientos permitido" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_picking_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_picking_ids +msgid "Allowed Picking" +msgstr "Albaranes permitidos" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_product_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_product_ids +msgid "Allowed Product" +msgstr "Producto Permitido" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "Category" +msgstr "Categoría" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Close" +msgstr "Cerrar" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"Comment anything relevant to the return, like serial numbers, a description " +"of the issue, etc" +msgstr "" +"Comente cualquier asunto relevante relacionado con la devolución, como " +"números de serie, descripción del problema, etc" + +#. module: rma_sale +#: model:ir.model.fields,help:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "" +"Conversion between Units of Measure can only occur if they belong to the " +"same category. The conversion will be made based on the ratios." +msgstr "" +"La conversión entre las unidades de medidas sólo pueden ocurrir si " +"pertenecen a la misma categoría. La conversión se basará en los ratios " +"establecidos." + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:48 +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +#, python-format +msgid "Create RMA" +msgstr "Crear RMA" + +#. module: rma_sale +#: model:ir.actions.act_window,name:rma_sale.sale_order_create_rma_action +msgid "Create RMAs" +msgstr "Crear RMAs" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Delivery" +msgstr "Entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__picking_id +msgid "Delivery order" +msgstr "Orden de entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__description +msgid "Description" +msgstr "Descripción" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__display_name +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__id +msgid "ID" +msgstr "ID" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "If no requested operation is set, the RMA won't be correctly fulfilled" +msgstr "" +"Si no se establece operación solicitada, el RMA no se procesará correctamente" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard____last_update +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard____last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__line_ids +msgid "Lines" +msgstr "Líneas" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__move_id +msgid "Move" +msgstr "Movimiento" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__order_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__order_id +msgid "Order" +msgstr "Orden" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__picking_id +msgid "Origin Delivery" +msgstr "Orden de Entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__move_id +msgid "Origin move" +msgstr "Movimiento" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__product_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__product_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Product" +msgstr "Producto" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__quantity +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Quantity" +msgstr "Cantidad" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_rma +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +msgid "RMA" +msgstr "RMA" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_count +msgid "RMA count" +msgstr "Cantidad de RMAs" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__location_id +msgid "RMA location" +msgstr "Ubicación de RMA" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_ids +msgid "RMAs" +msgstr "RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Request RMAs" +msgstr "Solicitar RMAs" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__operation_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Requested operation" +msgstr "Operación solicitada" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order +#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id +msgid "Sale Order" +msgstr "Pedido de venta" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line_rma_wizard +msgid "Sale Order Line Rma Wizard" +msgstr "Linea de Asistente de Orden de Venta - RMA " + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_rma_wizard +msgid "Sale Order Rma Wizard" +msgstr "Asistente de Orden de Venta - RMA" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line +msgid "Sales Order Line" +msgstr "Línea de pedido de venta" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Select the product quantity and the requested operation" +msgstr "Selecciones la cantidad de producto y la operación solicitada" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de existencias" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "The limit will decrease when the units in other RMAs are confirmed" +msgstr "El límite disminuirá cuando las unidades de otros RMAs sean confirmadas" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_id +msgid "Unit of Measure" +msgstr "Unidad de medida" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"Use the comment button to add relevant information regarding the RMA, like " +"returned serial numbers or a description of the issue" +msgstr "" +"Utilice el botón de comentarios para añadir información relevante " +"relacionada con el RMA, como números de serie devueltos o una descripción " +"del problema" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__wizard_id +msgid "Wizard" +msgstr "Asistente" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"You can only return as much product units as you received for this order" +msgstr "" +"Solo puede devolver tanta cantidad de producto como usted recibió en el " +"pedido original" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "You can send a message in every RMA sent" +msgstr "Puede mandar un mensaje en cada RMA enviado" + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:34 +#, python-format +msgid "You may only create RMAs from a confirmed or done sale order." +msgstr "Solo puedes crear RMAs desde una orden de venta confirmada o hecha." + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"You're about to perform an RMA request. Our team will process it an will " +"reach you once it's validated. Keep in mind that:" +msgstr "" +"Va a realizar una petición de RMA. Nuestro equipo la procesará y se pondrá " +"en contacto con usted una vez validad. Tenga en cuenta que:" + +#~ msgid "" +#~ "\n" +#~ " If an RMA has already been created for a " +#~ "product in this sales order, it will not\n" +#~ " be possible to create another one from " +#~ "the web portal.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Si ya se ha creado un RMA para un " +#~ "producto de esta orden de venta, no será\n" +#~ " posible crear otro desde el portal web.\n" +#~ " " + +#~ msgid "Domain Move" +#~ msgstr "Dominio de movimientos" + +#~ msgid "Domain Picking" +#~ msgstr "Dominio de entregas" + +#~ msgid "Domain Product" +#~ msgstr "Dominio de productos" + +#, fuzzy +#~| msgid "Delivery" +#~ msgid "Is Sale Delivery" +#~ msgstr "Es entrega de orden de venta" diff --git a/rma_sale/i18n/pt_BR.po b/rma_sale/i18n/pt_BR.po new file mode 100644 index 00000000..948a49bd --- /dev/null +++ b/rma_sale/i18n/pt_BR.po @@ -0,0 +1,379 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * rma_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-07-22 18:19+0000\n" +"Last-Translator: Fernando Colus \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: rma_sale +#: code:addons/rma_sale/controllers/sale_portal.py:39 +#, python-format +msgid " (Portal)" +msgstr " (Portal)" + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42 +#, python-format +msgid " has been created." +msgstr " foi criado(a)." + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44 +#, python-format +msgid " have been created." +msgstr " foi criado(a)." + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "&times;" +msgstr "&tempos;" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr " Requerer RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr " Requerer RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Cancel" +msgstr " Cancelar" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "" +"" +msgstr "" +"" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "RMA" +msgstr "RMA" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Requested operation:" +msgstr "Operação Requerida:" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Requested operation" +msgstr "Operação Requerida" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Sale order:" +msgstr "Pedido de Venda:" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Sale order" +msgstr "Pedido de Venda" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Accept" +msgstr "Aceitar" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_move_ids +msgid "Allowed Move" +msgstr "Movimentação Autorizada" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_picking_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_picking_ids +msgid "Allowed Picking" +msgstr "Coleta Autorizada" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_product_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_product_ids +msgid "Allowed Product" +msgstr "Produto Autorizado" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "Category" +msgstr "Categoria" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Close" +msgstr "Encerrar" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"Comment anything relevant to the return, like serial numbers, a description " +"of the issue, etc" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,help:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "" +"Conversion between Units of Measure can only occur if they belong to the " +"same category. The conversion will be made based on the ratios." +msgstr "" +"Uma conversão entre unidades de medida só poderá ocorrer se pertencer à " +"mesma categoria. A conversão será feita com base nas proporções." + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:48 +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +#, python-format +msgid "Create RMA" +msgstr "Criar RMA" + +#. module: rma_sale +#: model:ir.actions.act_window,name:rma_sale.sale_order_create_rma_action +msgid "Create RMAs" +msgstr "Criar RMAs" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_uid +msgid "Created by" +msgstr "Criado por" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_date +msgid "Created on" +msgstr "Criado em" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Delivery" +msgstr "Entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__picking_id +msgid "Delivery order" +msgstr "Ordem de Entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__description +msgid "Description" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__display_name +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__display_name +msgid "Display Name" +msgstr "Exibir Nome" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__id +msgid "ID" +msgstr "ID" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "If no requested operation is set, the RMA won't be correctly fulfilled" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard____last_update +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard____last_update +msgid "Last Modified on" +msgstr "Última modificação Feita em" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_uid +msgid "Last Updated by" +msgstr "Última Atualização Feita por" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_date +msgid "Last Updated on" +msgstr "Última Atualização Feita em" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__line_ids +msgid "Lines" +msgstr "Linhas" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__move_id +msgid "Move" +msgstr "Movimentação" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__order_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__order_id +msgid "Order" +msgstr "Pedido" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__picking_id +msgid "Origin Delivery" +msgstr "Origem da Entrega" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__move_id +msgid "Origin move" +msgstr "Origem da Movimentação" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__product_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__product_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Product" +msgstr "Produto" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__quantity +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Quantity" +msgstr "Quantidade" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_rma +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +msgid "RMA" +msgstr "RMA" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_count +msgid "RMA count" +msgstr "Contagem de RMA" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__location_id +msgid "RMA location" +msgstr "Localização do RMA" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_ids +msgid "RMAs" +msgstr "RMAs" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Request RMAs" +msgstr "Requisição de RMAs" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__operation_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Requested operation" +msgstr "Operação Requisitada" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order +#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id +msgid "Sale Order" +msgstr "Pedido de Venda" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line_rma_wizard +msgid "Sale Order Line Rma Wizard" +msgstr "Assistente da Linha do Pedido de Venda RMA" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_rma_wizard +msgid "Sale Order Rma Wizard" +msgstr "Assistente do Pedido de Venda RMA" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line +msgid "Sales Order Line" +msgstr "Linha do Pedido de Venda" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Select the product quantity and the requested operation" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "The limit will decrease when the units in other RMAs are confirmed" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_id +msgid "Unit of Measure" +msgstr "Unidade de Medida" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"Use the comment button to add relevant information regarding the RMA, like " +"returned serial numbers or a description of the issue" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__wizard_id +msgid "Wizard" +msgstr "Assistente" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"You can only return as much product units as you received for this order" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "You can send a message in every RMA sent" +msgstr "" + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:34 +#, python-format +msgid "You may only create RMAs from a confirmed or done sale order." +msgstr "" +"Você só pode criar RMAs a partir de um pedido de venda confirmado ou " +"concluído." + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "" +"You're about to perform an RMA request. Our team will process it an will " +"reach you once it's validated. Keep in mind that:" +msgstr "" + +#~ msgid "" +#~ "\n" +#~ " If an RMA has already been created for a " +#~ "product in this sales order, it will not\n" +#~ " be possible to create another one from " +#~ "the web portal.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Se um RMA já houver sido criado para um " +#~ "produto no pedido de venda,\n" +#~ " não será possível criar outro através do " +#~ "portal web.\n" +#~ " " diff --git a/rma_sale/i18n/rma_sale.pot b/rma_sale/i18n/rma_sale.pot new file mode 100644 index 00000000..66212562 --- /dev/null +++ b/rma_sale/i18n/rma_sale.pot @@ -0,0 +1,347 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * rma_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: rma_sale +#: code:addons/rma_sale/controllers/sale_portal.py:39 +#, python-format +msgid " (Portal)" +msgstr "" + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42 +#, python-format +msgid " has been created." +msgstr "" + +#. module: rma_sale +#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44 +#, python-format +msgid " have been created." +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "&times;" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Request RMAs" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid " Cancel" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_content +msgid "RMA" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Requested operation:" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Requested operation" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.report_rma_document +msgid "Sale order:" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.portal_rma_page +msgid "Sale order" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Accept" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_move_ids +msgid "Allowed Move" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_picking_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_picking_ids +msgid "Allowed Picking" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__allowed_product_ids +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__allowed_product_ids +msgid "Allowed Product" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.=sale_order_rma_wizard_form_view +msgid "Cancel" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "Category" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Close" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Comment anything relevant to the return, like serial numbers, a description of the issue, etc" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,help:rma_sale.field_sale_order_line_rma_wizard__uom_category_id +msgid "Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios." +msgstr "" + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:48 +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +#, python-format +msgid "Create RMA" +msgstr "" + +#. module: rma_sale +#: model:ir.actions.act_window,name:rma_sale.sale_order_create_rma_action +msgid "Create RMAs" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_uid +msgid "Created by" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__create_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__create_date +msgid "Created on" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Delivery" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__picking_id +msgid "Delivery order" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__description +msgid "Description" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__display_name +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__display_name +msgid "Display Name" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__id +msgid "ID" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "If no requested operation is set, the RMA won't be correctly fulfilled" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard____last_update +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard____last_update +msgid "Last Modified on" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_uid +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__write_date +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__write_date +msgid "Last Updated on" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__line_ids +msgid "Lines" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__move_id +msgid "Move" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__order_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__order_id +msgid "Order" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__picking_id +msgid "Origin Delivery" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__move_id +msgid "Origin move" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_rma__product_id +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__product_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Product" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__quantity +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Quantity" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_rma +#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form +msgid "RMA" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_count +msgid "RMA count" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__location_id +msgid "RMA location" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order__rma_ids +msgid "RMAs" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Request RMAs" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__operation_id +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Requested operation" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order +#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id +msgid "Sale Order" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line_rma_wizard +msgid "Sale Order Line Rma Wizard" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_rma_wizard +msgid "Sale Order Rma Wizard" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Select the product quantity and the requested operation" +msgstr "" + +#. module: rma_sale +#: model:ir.model,name:rma_sale.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "The limit will decrease when the units in other RMAs are confirmed" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_id +msgid "Unit of Measure" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "Use the comment button to add relevant information regarding the RMA, like returned serial numbers or a description of the issue" +msgstr "" + +#. module: rma_sale +#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__wizard_id +msgid "Wizard" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "You can only return as much product units as you received for this order" +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "You can send a message in every RMA sent" +msgstr "" + +#. module: rma_sale +#: code:addons/rma_sale/models/sale.py:34 +#, python-format +msgid "You may only create RMAs from a confirmed or done sale order." +msgstr "" + +#. module: rma_sale +#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template +msgid "You're about to perform an RMA request. Our team will process it an will reach you once it's validated. Keep in mind that:" +msgstr "" + diff --git a/rma_sale/models/__init__.py b/rma_sale/models/__init__.py new file mode 100644 index 00000000..0090dd37 --- /dev/null +++ b/rma_sale/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import rma +from . import sale +from . import stock_move diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py new file mode 100644 index 00000000..4fc540c1 --- /dev/null +++ b/rma_sale/models/rma.py @@ -0,0 +1,85 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class Rma(models.Model): + _inherit = "rma" + + order_id = fields.Many2one( + comodel_name="sale.order", + string="Sale Order", + domain="[" + " ('partner_id', 'child_of', commercial_partner_id)," + " ('state', 'in', ['sale', 'done'])," + "]", + readonly=True, + states={"draft": [("readonly", False)]}, + ) + allowed_picking_ids = fields.Many2many( + comodel_name="stock.picking", compute="_compute_allowed_picking_ids", + ) + picking_id = fields.Many2one(domain="[('id', 'in', allowed_picking_ids)]") + allowed_move_ids = fields.Many2many( + comodel_name="sale.order.line", compute="_compute_allowed_move_ids", + ) + move_id = fields.Many2one(domain="[('id', 'in', allowed_move_ids)]") + allowed_product_ids = fields.Many2many( + comodel_name="product.product", compute="_compute_allowed_product_ids", + ) + product_id = fields.Many2one(domain="[('id', 'in', allowed_product_ids)]") + + @api.depends("partner_id", "order_id") + def _compute_allowed_picking_ids(self): + domain = [("state", "=", "done"), ("picking_type_id.code", "=", "outgoing")] + for rec in self: + # if rec.partner_id: + commercial_partner = rec.partner_id.commercial_partner_id + domain.append(("partner_id", "child_of", commercial_partner.id)) + if rec.order_id: + domain.append(("sale_id", "=", rec.order_id.id)) + rec.allowed_picking_ids = self.env["stock.picking"].search(domain) + + @api.depends("order_id", "picking_id") + def _compute_allowed_move_ids(self): + for rec in self: + if rec.order_id: + order_move = rec.order_id.order_line.mapped("move_ids") + rec.allowed_move_ids = order_move.filtered( + lambda r: r.picking_id == self.picking_id + ).ids + else: + rec.allowed_move_ids = self.picking_id.move_lines.ids + + @api.depends("order_id") + def _compute_allowed_product_ids(self): + for rec in self: + if rec.order_id: + order_product = rec.order_id.order_line.mapped("product_id") + rec.allowed_product_ids = order_product.filtered( + lambda r: r.type in ["consu", "product"] + ).ids + else: + rec.allowed_product_ids = ( + self.env["product.product"] + .search([("type", "in", ["consu", "product"])]) + .ids + ) + + @api.onchange("partner_id") + def _onchange_partner_id(self): + res = super()._onchange_partner_id() + self.order_id = False + return res + + @api.onchange("order_id") + def _onchange_order_id(self): + self.product_id = self.picking_id = False + + def _prepare_refund(self, invoice_form, origin): + """Inject salesman from sales order (if any)""" + res = super()._prepare_refund(invoice_form, origin) + if self.order_id: + invoice_form.invoice_user_id = self.order_id.user_id + return res diff --git a/rma_sale/models/sale.py b/rma_sale/models/sale.py new file mode 100644 index 00000000..d2b58601 --- /dev/null +++ b/rma_sale/models/sale.py @@ -0,0 +1,128 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, fields, models +from odoo.exceptions import ValidationError + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + # RMAs that were created from a sale order + rma_ids = fields.One2many( + comodel_name="rma", inverse_name="order_id", string="RMAs", copy=False, + ) + rma_count = fields.Integer(string="RMA count", compute="_compute_rma_count") + + def _compute_rma_count(self): + rma_data = self.env["rma"].read_group( + [("order_id", "in", self.ids)], ["order_id"], ["order_id"] + ) + mapped_data = {r["order_id"][0]: r["order_id_count"] for r in rma_data} + for record in self: + record.rma_count = mapped_data.get(record.id, 0) + + def action_create_rma(self): + self.ensure_one() + if self.state not in ["sale", "done"]: + raise ValidationError( + _("You may only create RMAs from a " "confirmed or done sale order.") + ) + wizard_obj = self.env["sale.order.rma.wizard"] + line_vals = [ + ( + 0, + 0, + { + "product_id": data["product"].id, + "quantity": data["quantity"], + "uom_id": data["uom"].id, + "picking_id": data["picking"] and data["picking"].id, + }, + ) + for data in self.get_delivery_rma_data() + ] + wizard = wizard_obj.with_context(active_id=self.id).create( + {"line_ids": line_vals, "location_id": self.warehouse_id.rma_loc_id.id} + ) + return { + "name": _("Create RMA"), + "type": "ir.actions.act_window", + "view_mode": "form", + "res_model": "sale.order.rma.wizard", + "res_id": wizard.id, + "target": "new", + } + + def action_view_rma(self): + self.ensure_one() + action = self.env.ref("rma.rma_action").read()[0] + rma = self.rma_ids + if len(rma) == 1: + action.update( + res_id=rma.id, view_mode="form", views=[], + ) + else: + action["domain"] = [("id", "in", rma.ids)] + # reset context to show all related rma without default filters + action["context"] = {} + return action + + def get_delivery_rma_data(self): + self.ensure_one() + data = [] + for line in self.order_line: + data += line.prepare_sale_rma_data() + return data + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + def get_delivery_move(self): + self.ensure_one() + return self.move_ids.filtered( + lambda r: ( + self.product_id == r.product_id + and r.state == "done" + and not r.scrapped + and r.location_dest_id.usage == "customer" + and ( + not r.origin_returned_move_id + or (r.origin_returned_move_id and r.to_refund) + ) + ) + ) + + def prepare_sale_rma_data(self): + self.ensure_one() + product = self.product_id + if self.product_id.type != "product": + return {} + moves = self.get_delivery_move() + data = [] + if moves: + for move in moves: + qty = move.product_uom_qty + move_dest = move.move_dest_ids.filtered( + lambda r: r.state in ["partially_available", "assigned", "done"] + ) + qty -= sum(move_dest.mapped("product_uom_qty")) + data.append( + { + "product": product, + "quantity": qty, + "uom": move.product_uom, + "picking": move.picking_id, + } + ) + else: + data.append( + { + "product": product, + "quantity": self.qty_delivered, + "uom": self.product_uom, + "picking": False, + } + ) + return data diff --git a/rma_sale/models/stock_move.py b/rma_sale/models/stock_move.py new file mode 100644 index 00000000..382fcb8e --- /dev/null +++ b/rma_sale/models/stock_move.py @@ -0,0 +1,13 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockMove(models.Model): + _inherit = "stock.move" + + def _prepare_return_rma_vals(self, original_picking): + res = super()._prepare_return_rma_vals(original_picking) + res.update(order_id=original_picking.sale_id.id) + return res diff --git a/rma_sale/readme/CONTRIBUTORS.rst b/rma_sale/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..d4052271 --- /dev/null +++ b/rma_sale/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* `Tecnativa `_: + + * Ernesto Tejeda + * Pedro M. Baeza + * David Vidal diff --git a/rma_sale/readme/DESCRIPTION.rst b/rma_sale/readme/DESCRIPTION.rst new file mode 100644 index 00000000..baff386c --- /dev/null +++ b/rma_sale/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module allows you to link a sales order to an RMA. +This can be done by creating an RMA from scratch and selecting the sales +order, creating one or more RMAs from a sales order form view or from a sales +order web portal page. diff --git a/rma_sale/readme/ROADMAP.rst b/rma_sale/readme/ROADMAP.rst new file mode 100644 index 00000000..8d5d0f20 --- /dev/null +++ b/rma_sale/readme/ROADMAP.rst @@ -0,0 +1,5 @@ +* When you try to request an RMA from a Sales Order in the portal, + a popup appears and the inputs for the quantity doesn't allow + decimal numbers. It would be good to have a component that allows + that and at the same time keeps the constraint of not allowing a + number greater than the order line product quantity. diff --git a/rma_sale/readme/USAGE.rst b/rma_sale/readme/USAGE.rst new file mode 100644 index 00000000..fd3026cc --- /dev/null +++ b/rma_sale/readme/USAGE.rst @@ -0,0 +1,25 @@ +To use this module, you need to: + +#. Go to *RMA > Orders* and create a new RMA. +#. Select a sales order to be linked to the RMA if you want. +#. Now you can do the rest of the instructions described in the + *readme* of the rma module. + +If you want to create one or more RMAs from a sale order: + +#. Go to *Sales > Orders > Orders*. +#. Create a new sales order or select an existing one. +#. If the sales order is in 'Sales Order' state you can see in the status bar + a button labeled 'Create RMA', click it and a wizard will appear. +#. Modify the data at your convenience and click on 'Accept' button. +#. As many RMAs as lines with quantity greater than zero will be created. + Those RMAs will be linked to the sales order. + +The customer can also create RMAs from a sales order portal page: + +#. Go to a confirmed sales order portal page. +#. In the left sidebar you can see a button named 'Request RMAs'. +#. By clicking on this button a popup will appear to allow you to define + the quantity per product and delivery order line. +#. Click on the 'Request RMAs' button and RMAs will be created linked to + the sales order. diff --git a/rma_sale/static/description/icon.png b/rma_sale/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/rma_sale/static/description/icon.png differ diff --git a/rma_sale/static/description/index.html b/rma_sale/static/description/index.html new file mode 100644 index 00000000..6fab589d --- /dev/null +++ b/rma_sale/static/description/index.html @@ -0,0 +1,470 @@ + + + + + + +Return Merchandise Authorization Management - Link with Sales + + + + + + diff --git a/rma_sale/static/src/scss/rma_sale.scss b/rma_sale/static/src/scss/rma_sale.scss new file mode 100644 index 00000000..1b5a1b35 --- /dev/null +++ b/rma_sale/static/src/scss/rma_sale.scss @@ -0,0 +1,5 @@ +.request-rma-tbody { + td { + vertical-align: middle; + } +} diff --git a/rma_sale/tests/__init__.py b/rma_sale/tests/__init__.py new file mode 100644 index 00000000..89e73462 --- /dev/null +++ b/rma_sale/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_rma_sale diff --git a/rma_sale/tests/test_rma_sale.py b/rma_sale/tests/test_rma_sale.py new file mode 100644 index 00000000..c61ccbec --- /dev/null +++ b/rma_sale/tests/test_rma_sale.py @@ -0,0 +1,80 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests import Form, SavepointCase + + +class TestRmaSale(SavepointCase): + @classmethod + def setUpClass(cls): + super(TestRmaSale, cls).setUpClass() + cls.res_partner = cls.env["res.partner"] + cls.product_product = cls.env["product.product"] + cls.sale_order = cls.env["sale.order"] + + cls.product_1 = cls.product_product.create( + {"name": "Product test 1", "type": "product"} + ) + cls.product_2 = cls.product_product.create( + {"name": "Product test 2", "type": "product"} + ) + cls.partner = cls.res_partner.create({"name": "Partner test"}) + order_form = Form(cls.sale_order) + order_form.partner_id = cls.partner + with order_form.order_line.new() as line_form: + line_form.product_id = cls.product_1 + line_form.product_uom_qty = 5 + cls.sale_order = order_form.save() + cls.sale_order.action_confirm() + # Maybe other modules create additional lines in the create + # method in sale.order model, so let's find the correct line. + cls.order_line = cls.sale_order.order_line.filtered( + lambda r: r.product_id == cls.product_1 + ) + cls.order_out_picking = cls.sale_order.picking_ids + cls.order_out_picking.move_lines.quantity_done = 5 + cls.order_out_picking.button_validate() + + def test_create_rma_with_so(self): + rma_form = Form(self.env["rma"]) + rma_form.partner_id = self.partner + rma_form.order_id = self.sale_order + rma_form.product_id = self.product_1 + rma_form.product_uom_qty = 5 + rma_form.location_id = self.sale_order.warehouse_id.rma_loc_id + rma = rma_form.save() + rma.action_confirm() + self.assertTrue(rma.reception_move_id) + self.assertFalse(rma.reception_move_id.origin_returned_move_id) + + def test_create_rma_from_so(self): + order = self.sale_order + wizard_id = order.action_create_rma()["res_id"] + wizard = self.env["sale.order.rma.wizard"].browse(wizard_id) + rma = self.env["rma"].browse(wizard.create_and_open_rma()["res_id"]) + self.assertEqual(rma.partner_id, order.partner_id) + self.assertEqual(rma.order_id, order) + self.assertEqual(rma.picking_id, self.order_out_picking) + self.assertEqual(rma.move_id, self.order_out_picking.move_lines) + self.assertEqual(rma.product_id, self.product_1) + self.assertEqual(rma.product_uom_qty, self.order_line.product_uom_qty) + self.assertEqual(rma.product_uom, self.order_line.product_uom) + self.assertEqual(rma.state, "confirmed") + self.assertEqual( + rma.reception_move_id.origin_returned_move_id, + self.order_out_picking.move_lines, + ) + self.assertEqual( + rma.reception_move_id.picking_id + self.order_out_picking, + order.picking_ids, + ) + # Refund the RMA + user = self.env["res.users"].create( + {"login": "test_refund_with_so", "name": "Test"} + ) + order.user_id = user.id + rma.action_confirm() + rma.reception_move_id.quantity_done = rma.product_uom_qty + rma.reception_move_id.picking_id.action_done() + rma.action_refund() + self.assertEqual(rma.refund_id.user_id, user) diff --git a/rma_sale/views/assets.xml b/rma_sale/views/assets.xml new file mode 100644 index 00000000..e946398f --- /dev/null +++ b/rma_sale/views/assets.xml @@ -0,0 +1,12 @@ + + + + diff --git a/rma_sale/views/report_rma.xml b/rma_sale/views/report_rma.xml new file mode 100644 index 00000000..7bcc1688 --- /dev/null +++ b/rma_sale/views/report_rma.xml @@ -0,0 +1,17 @@ + + + + diff --git a/rma_sale/views/rma_views.xml b/rma_sale/views/rma_views.xml new file mode 100644 index 00000000..6247ed8d --- /dev/null +++ b/rma_sale/views/rma_views.xml @@ -0,0 +1,20 @@ + + + + + rma.view.form + rma + + + + + + + + + + + + + diff --git a/rma_sale/views/sale_portal_template.xml b/rma_sale/views/sale_portal_template.xml new file mode 100644 index 00000000..3063a429 --- /dev/null +++ b/rma_sale/views/sale_portal_template.xml @@ -0,0 +1,242 @@ + +