From f94eadee13dcd45f88bf2fe3a721c3cd49ad3f4b Mon Sep 17 00:00:00 2001 From: david Date: Fri, 14 Aug 2020 12:15:42 +0200 Subject: [PATCH] [FIX+IMP] rma: view permissions + portal views access errors + teams flow + Translated using Weblate (Spanish) [FIX] rma: views permissions Regular users don't have permissions to rma models, so we should avoid loading views that lead to permission errors. TT24986 rma 12.0.1.1.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: rma-12.0/rma-12.0-rma Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma/ [FIX] rma: portal views access errors - Portal mail thread needs token config. - Unpublished products will raise AccessError on RMAs portal views for portal users due to record rules. - Ensure active_id when getting actions in rma, since we could come from a context that pollutes the expected active rma id. [IMP] rma: teams flow - If no RMA Team is set, we'll assign a default one to the new RMA. - A sequence is now used to search for the top team and assign it. - No default user is assigned when it's not in the context (i.e. portal rmas). [UPD] Update rma.pot rma 12.0.1.2.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: rma-12.0/rma-12.0-rma Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma/ Translated using Weblate (Spanish) Currently translated at 96.2% (253 of 263 strings) Translation: rma-12.0/rma-12.0-rma Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma/es/ --- rma/README.rst | 19 ++- rma/__manifest__.py | 2 +- rma/i18n/es.po | 66 ++++----- rma/i18n/pt_BR.po | 200 ++++++++++++++++++---------- rma/i18n/rma.pot | 43 +++--- rma/models/rma.py | 29 +++- rma/models/rma_team.py | 3 +- rma/readme/USAGE.rst | 19 ++- rma/static/description/index.html | 25 +++- rma/views/res_partner_views.xml | 1 + rma/views/rma_portal_templates.xml | 12 +- rma/views/rma_team_views.xml | 11 ++ rma/views/stock_picking_views.xml | 1 + rma/views/stock_warehouse_views.xml | 1 + 14 files changed, 294 insertions(+), 138 deletions(-) diff --git a/rma/README.rst b/rma/README.rst index 788f6684..dea2df0f 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -89,8 +89,23 @@ An RMA can also be created from a return of a delivery order: Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -**Note: An RMA can also be created from an incoming email (See configuration -section).** +There are Optional RMA Teams that can be used for: + + - Organize RMAs in sections. + - Subscribe users to notifications. + - Create RMAs from incoming mail to special aliases (See configuration + section). + +To create an RMA Team (RMA Responsible user level required): + + #. Go to *RMA > Configuration > RMA Teams* + #. Create a new team and assign a name, a responsible and members. + #. Subscribe users to notifications, that can be of these subtypes: + + - RMA draft. When a new RMA is created. + - Notes, Debates, Activities. As in standard Odoo. + #. In the list view, use the cross handle to sort RMA Teams. The top team + will be the default one if no team is set. Known issues / Roadmap ====================== diff --git a/rma/__manifest__.py b/rma/__manifest__.py index c06a9a0a..469596da 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management", "summary": "Return Merchandise Authorization (RMA)", - "version": "12.0.1.0.0", + "version": "12.0.1.2.0", "development_status": "Beta", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma/i18n/es.po b/rma/i18n/es.po index 242403e8..e778d696 100644 --- a/rma/i18n/es.po +++ b/rma/i18n/es.po @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-21 05:13+0000\n" -"PO-Revision-Date: 2020-06-21 01:16-0400\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2020-08-18 13:59+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: \n" -"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" #. module: rma #: model:mail.template,report_name:rma.mail_template_rma_notification @@ -28,7 +28,7 @@ msgid "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" msgstr "" #. module: rma -#: code:addons/rma/models/rma_team.py:43 +#: code:addons/rma/models/rma_team.py:44 #, python-format msgid "%s (copy)" msgstr "%s (copia)" @@ -202,7 +202,6 @@ msgstr "Orden de Entrega:" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page #, fuzzy -#| msgid "Origin delivery:" msgid "Origin delivery" msgstr "Orden de Entrega:" @@ -325,7 +324,7 @@ msgstr "Modelo con seudónimo" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_view_form msgid "Are you sure you want to cancel this RMA" -msgstr "" +msgstr "¿Está seguro de querer cancelar este RMA?" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma__message_attachment_count @@ -538,7 +537,7 @@ msgid "Draft RMA" msgstr "RMA en estado Borrador" #. module: rma -#: code:addons/rma/models/rma.py:1076 +#: code:addons/rma/models/rma.py:1091 #, python-format msgid "" "E-mail subject: %s\n" @@ -641,7 +640,7 @@ msgstr "" "sin eliminarlo." #. module: rma -#: code:addons/rma/models/rma.py:1080 +#: code:addons/rma/models/rma.py:1095 #, python-format msgid "Incoming e-mail" msgstr "Correo electrónico entrante" @@ -747,8 +746,8 @@ msgid "Name" msgstr "Nombre" #. module: rma -#: code:addons/rma/models/rma.py:31 code:addons/rma/models/rma.py:496 -#: code:addons/rma/models/rma.py:1079 +#: code:addons/rma/models/rma.py:31 code:addons/rma/models/rma.py:495 +#: code:addons/rma/models/rma.py:1094 #, python-format msgid "New" msgstr "Nuevo" @@ -774,13 +773,13 @@ msgid "Next Activity Type" msgstr "Siguiente tipo de actividad" #. module: rma -#: code:addons/rma/models/rma.py:757 +#: code:addons/rma/models/rma.py:772 #, python-format msgid "None of the selected RMAs can perform a replacement." msgstr "Ninguno de los RMAs seleccionados puede realizar un reemplazo." #. module: rma -#: code:addons/rma/models/rma.py:740 +#: code:addons/rma/models/rma.py:755 #, python-format msgid "None of the selected RMAs can perform a return." msgstr "Ninguno de los RMAs seleccionados puede realizar una devolución." @@ -961,7 +960,7 @@ msgid "Quantity to extract" msgstr "Cantidad a extraer" #. module: rma -#: code:addons/rma/models/rma.py:790 +#: code:addons/rma/models/rma.py:805 #, python-format msgid "" "Quantity to extract cannot be greater than remaining delivery quantity (%s " @@ -1087,7 +1086,7 @@ msgstr "" #. module: rma #: model:ir.model,name:rma.model_rma_operation msgid "RMA requested operation" -msgstr "" +msgstr "Operación de RMA solicitada" #. module: rma #: model:ir.model.fields,field_description:rma.field_stock_move__rma_id @@ -1133,7 +1132,7 @@ msgid "Reference of the document that generated this RMA." msgstr "Referencia al documento que generó este RMA." #. module: rma -#: code:addons/rma/models/rma.py:679 +#: code:addons/rma/models/rma.py:693 #: model:ir.model.fields,field_description:rma.field_rma__refund_id #: model_terms:ir.ui.view,arch_db:rma.rma_view_form #: model:rma.operation,name:rma.rma_operation_refund @@ -1169,7 +1168,7 @@ msgstr "Ctd. entregada restante por realizar" #. module: rma #: model:rma.operation,name:rma.rma_operation_return msgid "Repair" -msgstr "" +msgstr "Reparar" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.rma_view_form @@ -1189,7 +1188,7 @@ msgid "Replaced" msgstr "Reemplazado" #. module: rma -#: code:addons/rma/models/rma.py:995 +#: code:addons/rma/models/rma.py:1010 #, python-format msgid "" "Replacement: Move %s) ha sido creado." #. module: rma -#: code:addons/rma/models/rma.py:1006 +#: code:addons/rma/models/rma.py:1021 #, python-format msgid "" "Replacement:
Product %s%s has been " @@ -1352,7 +1354,7 @@ msgstr "" #: model:ir.model.fields,field_description:rma.field_rma__state #: model_terms:ir.ui.view,arch_db:rma.rma_view_search msgid "State" -msgstr "Provincia" +msgstr "Estado" #. module: rma #: code:addons/rma/controllers/main.py:40 @@ -1398,7 +1400,7 @@ msgstr "Miembros del equipo" #. module: rma #: sql_constraint:rma.operation:0 msgid "That operation name already exists !" -msgstr "" +msgstr "¡El nombre de operación ya existe!" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_model_id @@ -1446,7 +1448,7 @@ msgstr "" "inicial porque el movimiento está enlazado a un RMA (%s)." #. module: rma -#: code:addons/rma/models/rma.py:778 +#: code:addons/rma/models/rma.py:793 #, python-format msgid "The quantity to return is greater than remaining quantity." msgstr "La cantidad a devolver es mayor que la cantidad restante del RMA." @@ -1462,19 +1464,19 @@ msgstr "" "cantidad especificada en el RMA asociado." #. module: rma -#: code:addons/rma/models/rma.py:767 +#: code:addons/rma/models/rma.py:782 #, python-format msgid "This RMA cannot be split." msgstr "Este RMA no puede ser dividido." #. module: rma -#: code:addons/rma/models/rma.py:754 +#: code:addons/rma/models/rma.py:769 #, python-format msgid "This RMA cannot perform a replacement." msgstr "Este RMA no puede realizar un reemplazo." #. module: rma -#: code:addons/rma/models/rma.py:737 +#: code:addons/rma/models/rma.py:752 #, python-format msgid "This RMA cannot perform a return." msgstr "Este RMA no puede realizar una devolución." @@ -1598,7 +1600,7 @@ msgid "Website communication history" msgstr "Historial de comunicaciones del sitio web" #. module: rma -#: code:addons/rma/models/rma.py:514 +#: code:addons/rma/models/rma.py:516 #, python-format msgid "You cannot delete RMAs that are not in draft state" msgstr "No puede " diff --git a/rma/i18n/pt_BR.po b/rma/i18n/pt_BR.po index 34cfc5f7..a64ce479 100644 --- a/rma/i18n/pt_BR.po +++ b/rma/i18n/pt_BR.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * rma +# * rma # msgid "" msgstr "" @@ -27,21 +27,23 @@ msgid "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" msgstr "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" #. module: rma -#: code:addons/rma/models/rma_team.py:43 +#: code:addons/rma/models/rma_team.py:44 #, python-format msgid "%s (copy)" msgstr "%s (Cópia)" #. module: rma #: model:mail.template,body_html:rma.mail_template_rma_notification -msgid "
\n" +msgid "" +"
\n" "

\n" " Dear ${object.partner_id.name}\n" " % if object.partner_id.parent_id:\n" " (${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" @@ -55,8 +57,8 @@ msgstr "" " (${object.partner_id.parent_id.name})\n" " % endif\n" "

\n" -" Aqui está o RMA ${object.name} from " -"${object.company_id.name}.\n" +" Aqui está o RMA ${object.name} from ${object.company_id." +"name}.\n" "

\n" " Não deixe de nos contactar se houver qualquer dúvida ou outra questão.\n" "

\n" @@ -65,10 +67,12 @@ 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 @@ -82,42 +86,54 @@ msgstr " Aguardando Pagamento" #. 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 -msgid "" +msgid "" +"" msgstr "" -"" +"" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page -msgid " Cancelled" +msgid "" +" Cancelled" msgstr "" " Cancelado" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page -msgid " Preparation" +msgid "" +" Preparation" msgstr "" " Preparo" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page -msgid " Shipped" +msgid "" +" Shipped" msgstr "" " Embarcado" #. module: rma #: model_terms:ir.ui.view,arch_db:rma.portal_rma_page -msgid " Partially Available" +msgid "" +" Partially Available" msgstr "" " Parcialmente Disponível" @@ -240,7 +256,9 @@ msgstr "Situação:" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_defaults -msgid "A Python dictionary that will be evaluated to provide default values when creating new records for this alias." +msgid "" +"A Python dictionary that will be evaluated to provide default values when " +"creating new records for this alias." msgstr "" "Um dicionário Python que será avaliado para fornecer valores padrão ao criar " "novos registros para esse alias." @@ -392,8 +410,7 @@ msgid "Confirm" msgstr "Confirmar" #. module: rma -#: model_terms:ir.ui.view,arch_db:rma.rma_view_search -#: selection:rma,state:0 +#: model_terms:ir.ui.view,arch_db:rma.rma_view_search selection:rma,state:0 msgid "Confirmed" msgstr "Confirmado(a)" @@ -507,8 +524,7 @@ msgid "Display Name" msgstr "Exibir Nome" #. module: rma -#: model_terms:ir.ui.view,arch_db:rma.rma_view_search -#: selection:rma,state:0 +#: model_terms:ir.ui.view,arch_db:rma.rma_view_search selection:rma,state:0 msgid "Draft" msgstr "Rascunho" @@ -519,9 +535,10 @@ msgid "Draft RMA" msgstr "Rascunho do RMA" #. module: rma -#: code:addons/rma/models/rma.py:1076 +#: code:addons/rma/models/rma.py:1091 #, python-format -msgid "E-mail subject: %s\n" +msgid "" +"E-mail subject: %s\n" "\n" "E-mail body:\n" "%s" @@ -586,7 +603,9 @@ msgstr "ID" #. 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)" +msgid "" +"ID of the parent record holding the alias (example: project holding the task " +"creation alias)" msgstr "" "ID do registro pai que contém o alias (exemplo: projeto que contém o alias " "de criação da tarefa)" @@ -611,13 +630,15 @@ msgstr "Se marcada, algumas mensagens apresentam um erro de entrega." #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__active -msgid "If the active field is set to false, it will allow you to hide the RMA Team without removing it." +msgid "" +"If the active field is set to false, it will allow you to hide the RMA Team " +"without removing it." msgstr "" "Se o campo ativo estiver definido como falso, permitirá ocultar a equipe RMA " "sem removê-lo." #. module: rma -#: code:addons/rma/models/rma.py:1080 +#: code:addons/rma/models/rma.py:1095 #, python-format msgid "Incoming e-mail" msgstr "E-mail recebido" @@ -723,9 +744,8 @@ msgid "Name" msgstr "Nome" #. module: rma -#: code:addons/rma/models/rma.py:31 -#: code:addons/rma/models/rma.py:496 -#: code:addons/rma/models/rma.py:1079 +#: code:addons/rma/models/rma.py:31 code:addons/rma/models/rma.py:495 +#: code:addons/rma/models/rma.py:1094 #, python-format msgid "New" msgstr "Novo(a)" @@ -751,13 +771,13 @@ msgid "Next Activity Type" msgstr "Tipo da Próxima Atividade" #. module: rma -#: code:addons/rma/models/rma.py:757 +#: code:addons/rma/models/rma.py:772 #, python-format msgid "None of the selected RMAs can perform a replacement." msgstr "Nenhum dos RMAs selecionados pode executar uma substituição." #. module: rma -#: code:addons/rma/models/rma.py:740 +#: code:addons/rma/models/rma.py:755 #, python-format msgid "None of the selected RMAs can perform a return." msgstr "Nenhum dos RMAs selecionados pode executar uma devolução." @@ -804,7 +824,10 @@ msgstr "Número de Mensagens Não Lidas" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_force_thread_id -msgid "Optional ID of a thread (record) to which all incoming messages will be attached, even if they did not reply to it. If set, this will disable the creation of new records completely." +msgid "" +"Optional ID of a thread (record) to which all incoming messages will be " +"attached, even if they did not reply to it. If set, this will disable the " +"creation of new records completely." msgstr "" "ID opcional de um encadeamento (registro) ao qual todas as mensagens " "recebidas serão anexadas, mesmo que não tenham respondido. Se definido, isso " @@ -852,7 +875,10 @@ msgstr "ID do Encadeamento do Registro Pai" #. 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) and task (model))" +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) and task (model))" msgstr "" "Modelo pai que contém o alias. O modelo que contém a referência de alias não " "é necessariamente o modelo fornecido pelo alias_model_id (exemplo: projeto " @@ -870,11 +896,12 @@ msgstr "Planejado)a)" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_contact -msgid "Policy to post a message on the document using the mailgateway.\n" +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 postar uma mensagem no documento usando o mail gateway.\n" "- todos: todos podem postar\n" @@ -920,8 +947,7 @@ msgid "Quantity" msgstr "Quantidade" #. module: rma -#: code:addons/rma/wizard/rma_delivery.py:49 -#: sql_constraint:rma.split.wizard:0 +#: code:addons/rma/wizard/rma_delivery.py:49 sql_constraint:rma.split.wizard:0 #, python-format msgid "Quantity must be greater than 0." msgstr "Quantidade precisa ser maior que zero." @@ -932,9 +958,11 @@ msgid "Quantity to extract" msgstr "Quantidade a extrair" #. module: rma -#: code:addons/rma/models/rma.py:790 +#: code:addons/rma/models/rma.py:805 #, python-format -msgid "Quantity to extract cannot be greater than remaining delivery quantity (%s %s)" +msgid "" +"Quantity to extract cannot be greater than remaining delivery quantity (%s " +"%s)" msgstr "" "A quantidade a extrair não pode ser maior que a quantidade de entrega " "restante (%s %s)" @@ -1082,8 +1110,7 @@ msgid "Receipt" msgstr "Recebimento" #. module: rma -#: model_terms:ir.ui.view,arch_db:rma.rma_view_search -#: selection:rma,state:0 +#: model_terms:ir.ui.view,arch_db:rma.rma_view_search selection:rma,state:0 msgid "Received" msgstr "Recebido" @@ -1103,7 +1130,7 @@ msgid "Reference of the document that generated this RMA." msgstr "Referência do documento que gerou este RMA." #. module: rma -#: code:addons/rma/models/rma.py:679 +#: code:addons/rma/models/rma.py:693 #: model:ir.model.fields,field_description:rma.field_rma__refund_id #: model_terms:ir.ui.view,arch_db:rma.rma_view_form #: model:rma.operation,name:rma.rma_operation_refund @@ -1159,18 +1186,25 @@ msgid "Replaced" msgstr "Substituído" #. module: rma -#: code:addons/rma/models/rma.py:995 +#: code:addons/rma/models/rma.py:1010 #, python-format -msgid "Replacement: Move %s (Picking %s) has been created." +msgid "" +"Replacement: Move %s (Picking %s) has been created." msgstr "" "Substituição: Movimentação %s (A Coleta %s foi criada." #. module: rma -#: code:addons/rma/models/rma.py:1006 +#: code:addons/rma/models/rma.py:1021 #, python-format -msgid "Replacement:
Product %s
Quantity %f %s
This replacement did not create a new move, but one of the previously created moves was updated with this data." +msgid "" +"Replacement:
Product %s
Quantity %f %s
This replacement did not " +"create a new move, but one of the previously created moves was updated with " +"this data." msgstr "" "Substituição:
Produto %s
Quantidade %f%s
Essa substituição não " @@ -1188,7 +1222,7 @@ msgid "Requested operation" msgstr "Operação Solicitada" #. module: rma -#: code:addons/rma/models/rma.py:721 +#: code:addons/rma/models/rma.py:736 #, python-format msgid "Required field(s):%s" msgstr "Campo(s) Solicitado(s):%s" @@ -1217,12 +1251,14 @@ msgid "Return to customer" msgstr "Retornar ao cliente" #. module: rma -#: code:addons/rma/models/rma.py:956 +#: code:addons/rma/models/rma.py:971 #, python-format -msgid "Return: %s has been created." +msgid "" +"Return: %s has been created." msgstr "" -"Retorno: %s foi criado." +"Retorno: %s foi criado." #. module: rma #: selection:rma,state:0 @@ -1259,6 +1295,11 @@ msgstr "Enviado(a) por Correio" msgid "Sent" msgstr "Enviado(a)" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_team__sequence +msgid "Sequence" +msgstr "" + #. module: rma #: code:addons/rma/models/stock_warehouse.py:48 #, python-format @@ -1298,9 +1339,11 @@ msgid "Split RMA" msgstr "Dividir RMA" #. module: rma -#: code:addons/rma/models/rma.py:874 +#: code:addons/rma/models/rma.py:889 #, python-format -msgid "Split: %s has been created." +msgid "" +"Split: %s has been " +"created." msgstr "" "Divisão: %s foi " "criada." @@ -1320,7 +1363,8 @@ msgstr "Status" #. module: rma #: model:ir.model.fields,help:rma.field_rma__activity_state -msgid "Status based on activities\n" +msgid "" +"Status based on activities\n" "Overdue: Due date is already passed\n" "Today: Activity date is today\n" "Planned: Future activities." @@ -1358,7 +1402,10 @@ msgstr "Esse nome de operação já existe!" #. 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)" +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)" msgstr "" "Modelo (tipo de documento Odoo) ao qual esse alias corresponde. Qualquer e-" "mail recebido que não responda a um registro existente causará a criação de " @@ -1366,14 +1413,20 @@ msgstr "" #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_name -msgid "The name of the email alias, e.g. 'jobs' if you want to catch emails for " +msgid "" +"The name of the email alias, e.g. 'jobs' if you want to catch emails for " +"" msgstr "" "O nome do alias do email, por exemplo 'jobs' se você deseja receber e-mails " "de " #. module: rma #: model:ir.model.fields,help:rma.field_rma_team__alias_user_id -msgid "The owner of records created upon receiving emails on this alias. If this field is not set the system will attempt to find the right owner based on the sender (From) address, or will use the Administrator account if no system user is found for that address." +msgid "" +"The owner of records created upon receiving emails on this alias. If this " +"field is not set the system will attempt to find the right owner based on " +"the sender (From) address, or will use the Administrator account if no " +"system user is found for that address." msgstr "" "O proprietário dos registros criados ao receber emails nesse alias. Se esse " "campo não estiver definido, o sistema tentará encontrar o proprietário certo " @@ -1383,13 +1436,15 @@ msgstr "" #. module: rma #: code:addons/rma/models/stock_move.py:60 #, python-format -msgid "The quantity done for the product '%s' must be equal to its initial demand because the stock move is linked to an RMA (%s)." +msgid "" +"The quantity done for the product '%s' must be equal to its initial demand " +"because the stock move is linked to an RMA (%s)." msgstr "" "A quantidade realizada para o produto '%s' deve ser igual à sua demanda " "inicial, porque a movimentação do estoque está vinculada a uma RMA (%s)." #. module: rma -#: code:addons/rma/models/rma.py:778 +#: code:addons/rma/models/rma.py:793 #, python-format msgid "The quantity to return is greater than remaining quantity." msgstr "A quantidade a retornar é maior que a quantidade restante." @@ -1397,25 +1452,27 @@ msgstr "A quantidade a retornar é maior que a quantidade restante." #. module: rma #: code:addons/rma/models/account_invoice.py:22 #, python-format -msgid "There is at least one invoice lines whose quantity is less than the quantity specified in its linked RMA." +msgid "" +"There is at least one invoice lines whose quantity is less than the quantity " +"specified in its linked RMA." msgstr "" "Há pelo menos uma linha de fatura cuja quantidade é menor que a quantidade " "especificada na sua RMA vinculada." #. module: rma -#: code:addons/rma/models/rma.py:767 +#: code:addons/rma/models/rma.py:782 #, python-format msgid "This RMA cannot be split." msgstr "Esta RMA não pode ser dividida." #. module: rma -#: code:addons/rma/models/rma.py:754 +#: code:addons/rma/models/rma.py:769 #, python-format msgid "This RMA cannot perform a replacement." msgstr "Esta RMA não pode executar uma substituição." #. module: rma -#: code:addons/rma/models/rma.py:737 +#: code:addons/rma/models/rma.py:752 #, python-format msgid "This RMA cannot perform a return." msgstr "Este RMA não pode executar uma devolução." @@ -1539,7 +1596,7 @@ msgid "Website communication history" msgstr "Histórico de Comunicação Através do Site" #. module: rma -#: code:addons/rma/models/rma.py:514 +#: code:addons/rma/models/rma.py:516 #, python-format msgid "You cannot delete RMAs that are not in draft state" msgstr "Você não pode apagar RMAs que não estejam na situação \"Rascunho\"" @@ -1547,14 +1604,17 @@ msgstr "Você não pode apagar RMAs que não estejam na situação \"Rascunho\"" #. module: rma #: code:addons/rma/wizard/stock_picking_return.py:56 #, python-format -msgid "You must specify the 'Customer' in the 'Stock Picking' from which RMAs will be created" +msgid "" +"You must specify the 'Customer' in the 'Stock Picking' from which RMAs will " +"be created" msgstr "" "Você deve especificar o 'Cliente' na 'Seleção de estoque' a partir do qual " "as RMAs serão criadas" #. module: rma #: model:res.groups,comment:rma.rma_group_user_all -msgid "the user will have access to all records of everyone in the RMA application." +msgid "" +"the user will have access to all records of everyone in the RMA application." msgstr "o usuário terá acesso a todos os registros de todos na aplicação RMA." #. module: rma @@ -1564,7 +1624,9 @@ msgstr "o usuário terá acesso aos seus próprios dados na aplicação RMA." #. module: rma #: model:res.groups,comment:rma.rma_group_manager -msgid "the user will have an access to the RMA configuration as well as statistic reports." +msgid "" +"the user will have an access to the RMA configuration as well as statistic " +"reports." msgstr "" "o usuário terá acesso à configuração RMA, bem como aos relatórios " "estatísticos." diff --git a/rma/i18n/rma.pot b/rma/i18n/rma.pot index 7b327b2b..6eac770e 100644 --- a/rma/i18n/rma.pot +++ b/rma/i18n/rma.pot @@ -24,7 +24,7 @@ msgid "${object.company_id.name} RMA (Ref ${object.name or 'n/a' })" msgstr "" #. module: rma -#: code:addons/rma/models/rma_team.py:43 +#: code:addons/rma/models/rma_team.py:44 #, python-format msgid "%s (copy)" msgstr "" @@ -486,7 +486,7 @@ msgid "Draft RMA" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:1076 +#: code:addons/rma/models/rma.py:1091 #, python-format msgid "E-mail subject: %s\n" "\n" @@ -576,7 +576,7 @@ msgid "If the active field is set to false, it will allow you to hide the RMA Te msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:1080 +#: code:addons/rma/models/rma.py:1095 #, python-format msgid "Incoming e-mail" msgstr "" @@ -683,8 +683,8 @@ msgstr "" #. module: rma #: code:addons/rma/models/rma.py:31 -#: code:addons/rma/models/rma.py:496 -#: code:addons/rma/models/rma.py:1079 +#: code:addons/rma/models/rma.py:495 +#: code:addons/rma/models/rma.py:1094 #, python-format msgid "New" msgstr "" @@ -710,13 +710,13 @@ msgid "Next Activity Type" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:757 +#: code:addons/rma/models/rma.py:772 #, python-format msgid "None of the selected RMAs can perform a replacement." msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:740 +#: code:addons/rma/models/rma.py:755 #, python-format msgid "None of the selected RMAs can perform a return." msgstr "" @@ -880,7 +880,7 @@ msgid "Quantity to extract" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:790 +#: code:addons/rma/models/rma.py:805 #, python-format msgid "Quantity to extract cannot be greater than remaining delivery quantity (%s %s)" msgstr "" @@ -1049,7 +1049,7 @@ msgid "Reference of the document that generated this RMA." msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:679 +#: code:addons/rma/models/rma.py:693 #: model:ir.model.fields,field_description:rma.field_rma__refund_id #: model_terms:ir.ui.view,arch_db:rma.rma_view_form #: model:rma.operation,name:rma.rma_operation_refund @@ -1105,13 +1105,13 @@ msgid "Replaced" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:995 +#: code:addons/rma/models/rma.py:1010 #, python-format msgid "Replacement: Move %s (Picking %s) has been created." msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:1006 +#: code:addons/rma/models/rma.py:1021 #, python-format msgid "Replacement:
Product %s
Quantity %f %s
This replacement did not create a new move, but one of the previously created moves was updated with this data." msgstr "" @@ -1127,7 +1127,7 @@ msgid "Requested operation" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:721 +#: code:addons/rma/models/rma.py:736 #, python-format msgid "Required field(s):%s" msgstr "" @@ -1156,7 +1156,7 @@ msgid "Return to customer" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:956 +#: code:addons/rma/models/rma.py:971 #, python-format msgid "Return: %s has been created." msgstr "" @@ -1196,6 +1196,11 @@ msgstr "" msgid "Sent" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_team__sequence +msgid "Sequence" +msgstr "" + #. module: rma #: code:addons/rma/models/stock_warehouse.py:48 #, python-format @@ -1235,7 +1240,7 @@ msgid "Split RMA" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:874 +#: code:addons/rma/models/rma.py:889 #, python-format msgid "Split: %s has been created." msgstr "" @@ -1309,7 +1314,7 @@ msgid "The quantity done for the product '%s' must be equal to its initial deman msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:778 +#: code:addons/rma/models/rma.py:793 #, python-format msgid "The quantity to return is greater than remaining quantity." msgstr "" @@ -1321,19 +1326,19 @@ msgid "There is at least one invoice lines whose quantity is less than the quant msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:767 +#: code:addons/rma/models/rma.py:782 #, python-format msgid "This RMA cannot be split." msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:754 +#: code:addons/rma/models/rma.py:769 #, python-format msgid "This RMA cannot perform a replacement." msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:737 +#: code:addons/rma/models/rma.py:752 #, python-format msgid "This RMA cannot perform a return." msgstr "" @@ -1457,7 +1462,7 @@ msgid "Website communication history" msgstr "" #. module: rma -#: code:addons/rma/models/rma.py:514 +#: code:addons/rma/models/rma.py:516 #, python-format msgid "You cannot delete RMAs that are not in draft state" msgstr "" diff --git a/rma/models/rma.py b/rma/models/rma.py index 8367c5b3..8a9ddcd8 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -55,7 +55,6 @@ class Rma(models.Model): comodel_name="res.users", string="Responsible", track_visibility="always", - default=lambda self: self.env.user, states={ 'locked': [('readonly', True)], 'cancelled': [('readonly', True)], @@ -499,6 +498,9 @@ class Rma(models.Model): ir_sequence = ir_sequence.with_context( force_company=vals['company_id']) vals['name'] = ir_sequence.next_by_code('rma') + # Assign a default team_id which will be the first in the sequence + if "team_id" not in vals: + vals["team_id"] = self.env["rma.team"].search([], limit=1).id return super().create(vals) def copy(self, default=None): @@ -599,7 +601,10 @@ class Rma(models.Model): """Invoked when 'Replace' button in rma form view is clicked.""" self.ensure_one() self._ensure_can_be_replaced() - action = self.env.ref("rma.rma_delivery_wizard_action").read()[0] + # Force active_id to avoid issues when coming from smart buttons + # in other models + action = self.env.ref("rma.rma_delivery_wizard_action").with_context( + active_id=self.id).read()[0] action['name'] = 'Replace product(s)' action['context'] = dict(self.env.context) action['context'].update( @@ -615,7 +620,10 @@ class Rma(models.Model): """ self.ensure_one() self._ensure_can_be_returned() - action = self.env.ref("rma.rma_delivery_wizard_action").read()[0] + # Force active_id to avoid issues when coming from smart buttons + # in other models + action = self.env.ref("rma.rma_delivery_wizard_action").with_context( + active_id=self.id).read()[0] action['context'] = dict(self.env.context) action['context'].update( active_id=self.id, @@ -628,9 +636,12 @@ class Rma(models.Model): """Invoked when 'Split' button in rma form view is clicked.""" self.ensure_one() self._ensure_can_be_split() - action = self.env.ref("rma.rma_split_wizard_action").read()[0] + # Force active_id to avoid issues when coming from smart buttons + # in other models + action = self.env.ref("rma.rma_split_wizard_action").with_context( + active_id=self.id).read()[0] action['context'] = dict(self.env.context) - action['context'].update(active_ids=self.ids) + action['context'].update(active_id=self.id, active_ids=self.ids) return action def action_cancel(self): @@ -663,7 +674,10 @@ class Rma(models.Model): def action_view_receipt(self): """Invoked when 'Receipt' smart button in rma form view is clicked.""" self.ensure_one() - action = self.env.ref('stock.action_picking_tree_all').read()[0] + # Force active_id to avoid issues when coming from smart buttons + # in other models + action = self.env.ref('stock.action_picking_tree_all').with_context( + active_id=self.id).read()[0] action.update( res_id=self.reception_move_id.picking_id.id, view_mode="form", @@ -687,7 +701,8 @@ class Rma(models.Model): def action_view_delivery(self): """Invoked when 'Delivery' smart button in rma form view is clicked.""" - action = self.env.ref('stock.action_picking_tree_all').read()[0] + action = self.env.ref('stock.action_picking_tree_all').with_context( + active_id=self.id).read()[0] picking = self.delivery_move_ids.mapped('picking_id') if len(picking) > 1: action['domain'] = [('id', 'in', picking.ids)] diff --git a/rma/models/rma_team.py b/rma/models/rma_team.py index 31b60097..018fa882 100644 --- a/rma/models/rma_team.py +++ b/rma/models/rma_team.py @@ -8,8 +8,9 @@ class RmaTeam(models.Model): _name = "rma.team" _inherit = ['mail.alias.mixin', 'mail.thread'] _description = "RMA Team" - _order = "name" + _order = "sequence, name" + sequence = fields.Integer() name = fields.Char( required=True, translate=True, diff --git a/rma/readme/USAGE.rst b/rma/readme/USAGE.rst index 6e6194a9..aa524e7a 100644 --- a/rma/readme/USAGE.rst +++ b/rma/readme/USAGE.rst @@ -33,5 +33,20 @@ An RMA can also be created from a return of a delivery order: Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -**Note: An RMA can also be created from an incoming email (See configuration -section).** +There are Optional RMA Teams that can be used for: + + - Organize RMAs in sections. + - Subscribe users to notifications. + - Create RMAs from incoming mail to special aliases (See configuration + section). + +To create an RMA Team (RMA Responsible user level required): + + #. Go to *RMA > Configuration > RMA Teams* + #. Create a new team and assign a name, a responsible and members. + #. Subscribe users to notifications, that can be of these subtypes: + + - RMA draft. When a new RMA is created. + - Notes, Debates, Activities. As in standard Odoo. + #. In the list view, use the cross handle to sort RMA Teams. The top team + will be the default one if no team is set. diff --git a/rma/static/description/index.html b/rma/static/description/index.html index a45186e6..88523ce3 100644 --- a/rma/static/description/index.html +++ b/rma/static/description/index.html @@ -440,8 +440,29 @@ stock location and click on ‘Return’ button. Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -

Note: An RMA can also be created from an incoming email (See configuration -section).

+

There are Optional RMA Teams that can be used for:

+
+
    +
  • Organize RMAs in sections.
  • +
  • Subscribe users to notifications.
  • +
  • Create RMAs from incoming mail to special aliases (See configuration +section).
  • +
+
+

To create an RMA Team (RMA Responsible user level required):

+
+
    +
  1. Go to RMA > Configuration > RMA Teams
  2. +
  3. Create a new team and assign a name, a responsible and members.
  4. +
  5. Subscribe users to notifications, that can be of these subtypes:
      +
    • RMA draft. When a new RMA is created.
    • +
    • Notes, Debates, Activities. As in standard Odoo.
    • +
    +
  6. +
  7. In the list view, use the cross handle to sort RMA Teams. The top team +will be the default one if no team is set.
  8. +
+

Known issues / Roadmap

diff --git a/rma/views/res_partner_views.xml b/rma/views/res_partner_views.xml index d783f1f6..bdf58616 100644 --- a/rma/views/res_partner_views.xml +++ b/rma/views/res_partner_views.xml @@ -6,6 +6,7 @@ res.partner.form res.partner +
-
+ +
Product
- +
@@ -262,6 +265,9 @@

Communication

+ + +
diff --git a/rma/views/rma_team_views.xml b/rma/views/rma_team_views.xml index 328e1ee6..9202da2d 100644 --- a/rma/views/rma_team_views.xml +++ b/rma/views/rma_team_views.xml @@ -2,6 +2,17 @@ + + rma.team + + + + + + + + + rma.team.view.form rma.team diff --git a/rma/views/stock_picking_views.xml b/rma/views/stock_picking_views.xml index d1f75400..95734fb0 100644 --- a/rma/views/stock_picking_views.xml +++ b/rma/views/stock_picking_views.xml @@ -6,6 +6,7 @@ stock.picking.form stock.picking +