From dd03cb78f1f35772422562c0d236a07097d7dcbc Mon Sep 17 00:00:00 2001
From: Nikolaus Weingartmair
- Dear ${object.partner_id.name}
- % if object.partner_id.parent_id:
- (${object.partner_id.parent_id.name})
- % endif
-
- Dear ${object.partner_id.name}
- % if object.partner_id.parent_id:
- (${object.partner_id.parent_id.name})
- % endif
-
+ Dear
+
- Dear ${object.partner_id.name}
- % if object.partner_id.parent_id:
- (${object.partner_id.parent_id.name})
- % endif
-
+ Dear
+ \n"
+#| " Dear ${object.partner_id.name}\n"
+#| " % if object.partner_id.parent_id:\n"
+#| " (${object.partner_id.parent_id.name})\n"
+#| " % endif\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"
+#| " Dear ${object.partner_id.name}\n"
+#| " % if object.partner_id.parent_id:\n"
+#| " (${object.partner_id.parent_id.name})\n"
+#| " % endif\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"
+" Dear\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"
-" Dear ${object.partner_id.name}\n"
-" % if object.partner_id.parent_id:\n"
-" (${object.partner_id.parent_id.name})\n"
-" % endif\n"
-" \n"
+" Dear\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"
-#~ " Dear ${object.partner_id.name}\n"
-#~ " % if object.partner_id.parent_id:\n"
-#~ " (${object.partner_id.parent_id.name})\n"
-#~ " % endif\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"
-" Dear ${object.partner_id.name}\n"
-" % if object.partner_id.parent_id:\n"
-" (${object.partner_id.parent_id.name})\n"
-" % endif\n"
-" \n"
+" Dear\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"
+" Dear\n"
+" This module allows you to manage Return Merchandise Authorization (RMA).
RMA documents can be created from scratch, from a delivery order or from
an incoming email. Product receptions and returning delivery operations
@@ -494,7 +494,7 @@ the product of that move is.
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.
- Here is the RMA ${object.name} from ${object.company_id.name}.
-
- Do not hesitate to contact us if you have any question.
-
+
+ Here is the RMA
+
+
+
+ Do not hesitate to contact us if you have any question.
+
- The products for your RMA ${object.name}
- from ${object.company_id.name} have been received in our warehouse.
-
- Do not hesitate to contact us if you have any question.
-
+
+ The products for your RMA
+
+
+
+ Do not hesitate to contact us if you have any question.
+
- You've succesfully placed your RMA ${object.name}
- on ${object.company_id.name}. Our team will check it and will validate
- it as soon as possible.
-
- Do not hesitate to contact us if you have any question.
-
+
+ You've succesfully placed your RMA
+
+
+
+ Do not hesitate to contact us if you have any question.
+
E-mail body:
%s"
+#, fuzzy, python-format
+#| msgid "E-mail subject: %s
E-mail body:
%s"
+msgid ""
+"E-mail subject: %(subject)s
E-mail body:
%(body)s"
msgstr ""
-"Asunto del correo electrónico: %s
Cuerpo del correo "
-"electrónico:
%s"
+"Asunto del correo electrónico: %(subject)s
Cuerpo del correo "
+"electrónico:
%(body)s"
#. module: rma
#: model:mail.template,body_html:rma.mail_template_rma_notification
+#, fuzzy
+#| msgid ""
+#| "
\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"
-" 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"
+"
\n"
+" Here is the RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+" \n"
"
\n"
+#| " The products for your RMA ${object.name}\n"
+#| " from ${object.company_id.name} have been received in our warehouse.\n"
+#| "
\n"
+#| " Do not hesitate to contact us if you have any question.\n"
+#| "
\n"
-" The products for your RMA ${object.name}\n"
-" from ${object.company_id.name} have been received in our warehouse.\n"
-"
\n"
-" Do not hesitate to contact us if you have any question.\n"
-"
\n"
+"
\n"
+" The products for your RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+"
\n"
+#| " You've succesfully placed your RMA ${object.name}\n"
+#| " on ${object.company_id.name}. Our team will check it and will "
+#| "validate\n"
+#| " it as soon as possible.\n"
+#| "
\n"
+#| " Do not hesitate to contact us if you have any question.\n"
+#| "
\n"
-" You've succesfully placed your RMA ${object.name}\n"
-" on ${object.company_id.name}. Our team will check it and will validate\n"
-" it as soon as possible.\n"
-"
\n"
-" Do not hesitate to contact us if you have any question.\n"
-"
\n"
+"
\n"
+" You've succesfully placed your RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+"
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."
+"data-oe-id=\"%(id)d\">%(name)s
Quantity %(qty)s %(uom)s
This "
+"replacement did not create a new move, but one of the previously created "
+"moves was updated with this data."
msgstr ""
"Reemplazo:
Producto %s
Cantidad %f %s
El reemplazo realizado no creó un "
-"movimiento nuevo, pero uno de los movimientos creados anteriormente fué "
-"actualizado con estos datos."
+"oe-id=\"%(id)d\">%(name)s
Cantidad %(qty) s%(uom)s
El reemplazo "
+"realizado no creó un movimiento nuevo, pero uno de los movimientos creados "
+"anteriormente fué actualizado con estos datos."
#. module: rma
#: model:ir.ui.menu,name:rma.rma_reporting_menu
@@ -1745,11 +1769,11 @@ msgstr "Devolver al cliente"
#: code:addons/rma/models/rma.py:0
#, python-format
msgid ""
-"Return: %s"
-"a> has been created."
+"Return: "
+"%(name)s has been created."
msgstr ""
"Devolución: La orden de entrega %s ha sido creada."
+"\" data-oe-id=\"%(id)d\">%(name)s ha sido creada."
#. module: rma
#: model:ir.model.fields.selection,name:rma.selection__rma__state__returned
@@ -1887,11 +1911,11 @@ msgstr "Dividir RMA"
#: code:addons/rma/models/rma.py:0
#, python-format
msgid ""
-"Split: %s has been "
-"created."
+"Split: %(name)s"
+"a> has been created."
msgstr ""
-"División: El RMA %s"
-"a> ha sido creado."
+"División: El RMA "
+"%(name)s ha sido creado."
#. module: rma
#: model:ir.model.fields,field_description:rma.field_rma__state
@@ -1968,7 +1992,7 @@ msgstr "¡El nombre de operación ya existe!"
#. module: rma
#: model:ir.model.fields,help:rma.field_rma_tag__active
msgid "The active field allows you to hide the category without removing it."
-msgstr ""
+msgstr "El campo activo le permite ocultar la clase sin tener que eliminarla."
#. module: rma
#: model:ir.model.fields,help:rma.field_rma_team__alias_model_id
@@ -2008,11 +2032,11 @@ msgstr ""
#: code:addons/rma/models/stock_move.py:0
#, 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)."
+"The quantity done for the product '%(id)s' must be equal to its initial "
+"demand because the stock move is linked to an RMA (%(name)s)."
msgstr ""
-"La cantidad realizada para el producto '%s' debe ser igual a la demanda "
-"inicial porque el movimiento está enlazado a un RMA (%s)."
+"La cantidad realizada para el producto '%(id)s' debe ser igual a la demanda "
+"inicial porque el movimiento está enlazado a un RMA (%(name)s)."
#. module: rma
#: code:addons/rma/models/rma.py:0
@@ -2077,7 +2101,7 @@ msgstr "Tipo de operación"
#. module: rma
#: model:ir.model.fields,help:rma.field_rma__activity_exception_decoration
msgid "Type of the exception activity on record."
-msgstr ""
+msgstr "Tipo de actividad de excepción en registro."
#. module: rma
#: model_terms:ir.ui.view,arch_db:rma.rma_view_search
@@ -2247,3 +2271,36 @@ msgid ""
msgstr ""
"El usuario tendrá acceso a la configuración de RMA y a los informes "
"estadísticos."
+
+#. module: rma
+#: model:mail.template,report_name:rma.mail_template_rma_draft_notification
+#: model:mail.template,report_name:rma.mail_template_rma_notification
+#: model:mail.template,report_name:rma.mail_template_rma_receipt_notification
+msgid "{{(object.name or '')}}"
+msgstr "{{(object.name or '')}}"
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_notification
+msgid "{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }})"
+msgstr "{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }})"
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_receipt_notification
+msgid ""
+"{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }}) products "
+"received"
+msgstr ""
+"{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }}) productos "
+"recibidos"
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_draft_notification
+msgid ""
+"{{object.company_id.name}} Your RMA has been succesfully created (Ref "
+"{{object.name or 'n/a' }})"
+msgstr ""
+"{{object.company_id.name}} Su RMA se ha creado con éxito (Ref {{object.name "
+"or 'n/a' }})"
+
+#~ msgid "Followers (Channels)"
+#~ msgstr "Seguidores (Canales)"
diff --git a/rma/i18n/it.po b/rma/i18n/it.po
index 07944e22..8fb7f7c3 100644
--- a/rma/i18n/it.po
+++ b/rma/i18n/it.po
@@ -2255,6 +2255,3 @@ msgid ""
"the user will have an access to the RMA configuration as well as statistic "
"reports."
msgstr "l'utente avrà accesso alla configurazione RMA e ai report statistici."
-
-#~ msgid "Invoicing address:"
-#~ msgstr "Indirizzo di fatturazione:"
diff --git a/rma/i18n/pt.po b/rma/i18n/pt.po
index f4179561..b80fca20 100644
--- a/rma/i18n/pt.po
+++ b/rma/i18n/pt.po
@@ -2188,6 +2188,3 @@ msgid ""
msgstr ""
"o utilizador terá acesso à configuração RMA, bem como aos relatórios "
"estatísticos."
-
-#~ msgid "Invoicing address:"
-#~ msgstr "Endereço de Cobrança:"
diff --git a/rma/i18n/pt_BR.po b/rma/i18n/pt_BR.po
index 725841c5..a87e7285 100644
--- a/rma/i18n/pt_BR.po
+++ b/rma/i18n/pt_BR.po
@@ -2183,88 +2183,3 @@ msgid ""
msgstr ""
"o usuário terá acesso à configuração RMA, bem como aos relatórios "
"estatísticos."
-
-#~ msgid "Invoicing address:"
-#~ msgstr "Endereço de Cobrança:"
-
-#~ msgid "Not urgent"
-#~ msgstr "Não é urgente"
-
-#~ msgid "Very Urgent"
-#~ msgstr "Muito Urgente"
-
-#~ msgid ""
-#~ "
\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"
-#~ " 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"
-#~ "
E-mail body:
%s"
+msgid ""
+"E-mail subject: %(subject)s
E-mail body:
%(body)s"
msgstr ""
#. module: rma
@@ -61,15 +36,24 @@ msgstr ""
msgid ""
"
\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"
+"
\n"
+" Here is the RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+" \n"
"
\n"
-" The products for your RMA ${object.name}\n"
-" from ${object.company_id.name} have been received in our warehouse.\n"
-"
\n"
-" Do not hesitate to contact us if you have any question.\n"
-"
\n"
+"
\n"
+" The products for your RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+"
\n"
-" You've succesfully placed your RMA ${object.name}\n"
-" on ${object.company_id.name}. Our team will check it and will validate\n"
-" it as soon as possible.\n"
-"
\n"
-" Do not hesitate to contact us if you have any question.\n"
-"
\n"
+"
\n"
+" You've succesfully placed your RMA\n"
+" \n"
+"
\n"
+"
\n"
+" Do not hesitate to contact us if you have any question.\n"
+"
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."
+"data-oe-id=\"%(id)d\">%(name)s
Quantity %(qty)s %(uom)s
This "
+"replacement did not create a new move, but one of the previously created "
+"moves was updated with this data."
msgstr ""
#. module: rma
@@ -1638,7 +1658,7 @@ msgstr ""
#, python-format
msgid ""
"Return: %s has been created."
+"id=\"%(id)d\">%(name)s has been created."
msgstr ""
#. module: rma
@@ -1777,8 +1797,8 @@ msgstr ""
#: code:addons/rma/models/rma.py:0
#, python-format
msgid ""
-"Split: %s has been"
-" created."
+"Split: %(name)s has been created."
msgstr ""
#. module: rma
@@ -1882,8 +1902,8 @@ msgstr ""
#: code:addons/rma/models/stock_move.py:0
#, 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)."
+"The quantity done for the product '%(id)s' must be equal to its initial "
+"demand because the stock move is linked to an RMA (%(name)s)."
msgstr ""
#. module: rma
@@ -2113,3 +2133,29 @@ msgid ""
"the user will have an access to the RMA configuration as well as statistic "
"reports."
msgstr ""
+
+#. module: rma
+#: model:mail.template,report_name:rma.mail_template_rma_draft_notification
+#: model:mail.template,report_name:rma.mail_template_rma_notification
+#: model:mail.template,report_name:rma.mail_template_rma_receipt_notification
+msgid "{{(object.name or '')}}"
+msgstr ""
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_notification
+msgid "{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }})"
+msgstr ""
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_receipt_notification
+msgid ""
+"{{object.company_id.name}} RMA (Ref {{object.name or 'n/a' }}) products "
+"received"
+msgstr ""
+
+#. module: rma
+#: model:mail.template,subject:rma.mail_template_rma_draft_notification
+msgid ""
+"{{object.company_id.name}} Your RMA has been succesfully created (Ref "
+"{{object.name or 'n/a' }})"
+msgstr ""
diff --git a/rma/i18n/ro.po b/rma/i18n/ro.po
index 30d5d9e8..bb122b14 100644
--- a/rma/i18n/ro.po
+++ b/rma/i18n/ro.po
@@ -2174,12 +2174,3 @@ msgid ""
"the user will have an access to the RMA configuration as well as statistic "
"reports."
msgstr ""
-
-#~ msgid "Invoicing address:"
-#~ msgstr "Adresă facturare:"
-
-#~ msgid "Not urgent"
-#~ msgstr "Nu e urgent"
-
-#~ msgid "Very Urgent"
-#~ msgstr "Forate urgent"
diff --git a/rma/models/rma.py b/rma/models/rma.py
index bc82a99f..8f2101b5 100644
--- a/rma/models/rma.py
+++ b/rma/models/rma.py
@@ -1,6 +1,6 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-
+import logging
from collections import Counter
from odoo import _, api, fields, models
@@ -10,6 +10,8 @@ from odoo.tools import html2plaintext
from odoo.addons.stock.models.stock_move import PROCUREMENT_PRIORITIES
+_logger = logging.getLogger(__name__)
+
class Rma(models.Model):
_name = "rma"
@@ -31,7 +33,6 @@ class Rma(models.Model):
# General fields
sent = fields.Boolean()
name = fields.Char(
- string="Name",
index=True,
readonly=True,
states={"draft": [("readonly", False)]},
@@ -40,31 +41,43 @@ class Rma(models.Model):
)
origin = fields.Char(
string="Source Document",
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
help="Reference of the document that generated this RMA.",
)
date = fields.Datetime(
- default=lambda self: fields.Datetime.now(),
+ default=fields.Datetime.now,
index=True,
required=True,
readonly=True,
states={"draft": [("readonly", False)]},
)
deadline = fields.Date(
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
)
user_id = fields.Many2one(
comodel_name="res.users",
string="Responsible",
index=True,
tracking=True,
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
)
team_id = fields.Many2one(
comodel_name="rma.team",
string="RMA team",
index=True,
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
)
tag_ids = fields.Many2many(comodel_name="rma.tag", string="Tags")
finalization_id = fields.Many2one(
@@ -72,13 +85,18 @@ class Rma(models.Model):
comodel_name="rma.finalization",
copy=False,
readonly=True,
- domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",
+ domain=(
+ "['|', ('company_id', '=', False), ('company_id', '='," " company_id)]"
+ ),
tracking=True,
)
company_id = fields.Many2one(
comodel_name="res.company",
default=lambda self: self.env.company,
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
)
partner_id = fields.Many2one(
string="Customer",
@@ -100,7 +118,9 @@ class Rma(models.Model):
comodel_name="res.partner",
readonly=True,
states={"draft": [("readonly", False)]},
- domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",
+ domain=(
+ "['|', ('company_id', '=', False), ('company_id', '='," " company_id)]"
+ ),
help="Refund address for current RMA.",
)
commercial_partner_id = fields.Many2one(
@@ -110,21 +130,25 @@ class Rma(models.Model):
picking_id = fields.Many2one(
comodel_name="stock.picking",
string="Origin Delivery",
- domain="["
- " ('state', '=', 'done'),"
- " ('picking_type_id.code', '=', 'outgoing'),"
- " ('partner_id', 'child_of', commercial_partner_id),"
- "]",
+ domain=(
+ "["
+ " ('state', '=', 'done'),"
+ " ('picking_type_id.code', '=', 'outgoing'),"
+ " ('partner_id', 'child_of', commercial_partner_id),"
+ "]"
+ ),
readonly=True,
states={"draft": [("readonly", False)]},
)
move_id = fields.Many2one(
comodel_name="stock.move",
string="Origin move",
- domain="["
- " ('picking_id', '=', picking_id),"
- " ('picking_id', '!=', False)"
- "]",
+ domain=(
+ "["
+ " ('picking_id', '=', picking_id),"
+ " ('picking_id', '!=', False)"
+ "]"
+ ),
readonly=True,
states={"draft": [("readonly", False)]},
)
@@ -159,7 +183,6 @@ class Rma(models.Model):
},
)
priority = fields.Selection(
- string="Priority",
selection=PROCUREMENT_PRIORITIES,
default="1",
readonly=True,
@@ -188,7 +211,10 @@ class Rma(models.Model):
tracking=True,
)
description = fields.Html(
- states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
+ states={
+ "locked": [("readonly", True)],
+ "cancelled": [("readonly", True)],
+ },
)
# Reception fields
location_id = fields.Many2one(
@@ -210,13 +236,11 @@ class Rma(models.Model):
# Refund fields
refund_id = fields.Many2one(
comodel_name="account.move",
- string="Refund",
readonly=True,
copy=False,
)
refund_line_id = fields.Many2one(
comodel_name="account.move.line",
- string="Refund line",
readonly=True,
copy=False,
)
@@ -234,13 +258,11 @@ class Rma(models.Model):
compute="_compute_delivery_picking_count",
)
delivered_qty = fields.Float(
- string="Delivered qty",
digits="Product Unit of Measure",
compute="_compute_delivered_qty",
store=True,
)
delivered_qty_done = fields.Float(
- string="Delivered qty done",
digits="Product Unit of Measure",
compute="_compute_delivered_qty",
compute_sudo=True,
@@ -447,7 +469,11 @@ class Rma(models.Model):
# Constrains methods (@api.constrains)
@api.constrains(
- "state", "partner_id", "partner_shipping_id", "partner_invoice_id", "product_id"
+ "state",
+ "partner_id",
+ "partner_shipping_id",
+ "partner_invoice_id",
+ "product_id",
)
def _check_required_after_draft(self):
"""Check that RMAs are being created or edited with the
@@ -695,6 +721,7 @@ class Rma(models.Model):
# in other models
action = (
self.env.ref("rma.rma_delivery_wizard_action")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -717,6 +744,7 @@ class Rma(models.Model):
# in other models
action = (
self.env.ref("rma.rma_delivery_wizard_action")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -736,6 +764,7 @@ class Rma(models.Model):
# in other models
action = (
self.env.ref("rma.rma_split_wizard_action")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -751,6 +780,7 @@ class Rma(models.Model):
# in other models
action = (
self.env.ref("rma.rma_finalization_wizard_action")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -792,6 +822,7 @@ class Rma(models.Model):
# in other models
action = (
self.env.ref("stock.action_picking_tree_all")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -820,6 +851,7 @@ class Rma(models.Model):
"""Invoked when 'Delivery' smart button in rma form view is clicked."""
action = (
self.env.ref("stock.action_picking_tree_all")
+ .sudo()
.with_context(active_id=self.id)
.read()[0]
)
@@ -929,10 +961,15 @@ class Rma(models.Model):
if to_split_uom_qty > self.remaining_qty:
raise ValidationError(
_(
- "Quantity to extract cannot be greater than remaining "
- "delivery quantity (%s %s)"
+ "Quantity to extract cannot be greater than remaining"
+ " delivery quantity (%(remaining_qty)s %(product_uom)s)"
+ )
+ % (
+ {
+ "remaining_qty": self.remaining_qty,
+ "product_uom": self.product_uom.name,
+ }
)
- % (self.remaining_qty, self.product_uom.name)
)
# Reception business methods
@@ -1030,12 +1067,9 @@ class Rma(models.Model):
self.message_post(
body=_(
'Split: %s has been created.'
- )
- % (
- extracted_rma.id,
- extracted_rma.name,
+ 'data-oe-id="%(id)d">%(name)s has been created.'
)
+ % ({"id": extracted_rma.id, "name": extracted_rma.name})
)
return extracted_rma
@@ -1143,9 +1177,9 @@ class Rma(models.Model):
rma.message_post(
body=_(
'Return: %s has been created.'
+ 'data-oe-id="%(id)d">%(name)s has been created.'
)
- % (picking.id, picking.name)
+ % ({"id": picking.id, "name": picking.name})
)
picking.action_confirm()
picking.action_assign()
@@ -1180,17 +1214,19 @@ class Rma(models.Model):
if new_move:
self.message_post(
body=_(
- "Replacement: "
- 'Move %s (Picking %s) '
- "has been created."
+ 'Replacement: Move %(move_name)s (Picking %(picking_name)s) has'
+ " been created."
)
% (
- new_move.id,
- new_move.name_get()[0][1],
- new_move.picking_id.id,
- new_move.picking_id.name,
+ {
+ "move_id": new_move.id,
+ "move_name": new_move.name_get()[0][1],
+ "picking_id": new_move.picking_id.id,
+ "picking_name": new_move.picking_id.name,
+ }
)
)
else:
@@ -1198,12 +1234,19 @@ class Rma(models.Model):
body=_(
"Replacement:
"
'Product %s
'
- "Quantity %f %s
"
+ 'data-oe-id="%(id)d">%(name)s
'
+ "Quantity %(qty)s %(uom)s
"
"This replacement did not create a new move, but one of "
"the previously created moves was updated with this data."
)
- % (product.id, product.display_name, qty, uom.name)
+ % (
+ {
+ "id": product.id,
+ "name": product.display_name,
+ "qty": qty,
+ "uom": uom.name,
+ }
+ )
)
if self.state != "waiting_replacement":
self.state = "waiting_replacement"
@@ -1291,10 +1334,10 @@ class Rma(models.Model):
custom_values = {}
subject = msg_dict.get("subject", "")
body = html2plaintext(msg_dict.get("body", ""))
- desc = _("E-mail subject: %s
E-mail body:
%s") % (
- subject,
- body,
- )
+ desc = _(
+ "E-mail subject: %(subject)s
E-mail"
+ " body:
%(body)s"
+ ) % ({"subject": subject, "body": body})
defaults = {
"description": desc,
"name": _("New"),
@@ -1336,8 +1379,8 @@ class Rma(models.Model):
record._message_add_suggested_recipient(
recipients, partner=record.partner_id, reason=_("Customer")
)
- except AccessError: # no read access rights
- pass
+ except AccessError as e: # no read access rights
+ _logger.debug(e)
return recipients
# Reporting business methods
diff --git a/rma/models/stock_move.py b/rma/models/stock_move.py
index 635db5d6..1e846eec 100644
--- a/rma/models/stock_move.py
+++ b/rma/models/stock_move.py
@@ -60,11 +60,16 @@ class StockMove(models.Model):
if rma_receiver and move.quantity_done != rma_receiver.product_uom_qty:
raise ValidationError(
_(
- "The quantity done for the product '%s' must "
+ "The quantity done for the product '%(id)s' must "
"be equal to its initial demand because the "
- "stock move is linked to an RMA (%s)."
+ "stock move is linked to an RMA (%(name)s)."
+ )
+ % (
+ {
+ "id": move.product_id.name,
+ "name": move.rma_receiver_ids.name,
+ }
)
- % (move.product_id.name, move.rma_receiver_ids.name)
)
res = super()._action_done(cancel_backorder=cancel_backorder)
move_done = self.filtered(lambda r: r.state == "done").sudo()
diff --git a/rma/readme/CONTRIBUTORS.rst b/rma/readme/CONTRIBUTORS.rst
index c93f1606..75646b6d 100644
--- a/rma/readme/CONTRIBUTORS.rst
+++ b/rma/readme/CONTRIBUTORS.rst
@@ -3,6 +3,7 @@
* Ernesto Tejeda
* Pedro M. Baeza
* David Vidal
+ * Víctor Martínez
* Chafique Delli
Do not contact contributors directly about support or help with technical issues.
Current maintainer:
-This module is part of the OCA/rma project on GitHub.
+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.
+
Create a new RMA finalization -
+
+Manage RMA finalization reasons to better classify them for tracking and analysis purposes.
Create a new RMA tag -
+
+Manage RMA tags to better classify them for tracking and analysis purposes.