Skip to content

Commit

Permalink
[MIG] rma: Migration to 18.0
Browse files Browse the repository at this point in the history
Changes done:
- Purge translations
- Remove migration scripts
- Change translations (_) to self.env._
- Change check_access_rights() method to has_access() method
- Change method _product_is_storable() to product_id.is_storable
- Set check_company=True to stock.warehouse fields
- Change domain of multi-company rules for better performance
- Change tree to list in views
- Change kanban-box to card
- Replace <div class="oe_chatter"> with <chatter />
- Remove unnecessary invisible fields in views
- Changes in portal templates
- Changes in stock.picking.return
- Change copy() methods to make them multi-records
- Remove copy() method from stock.picking, context key is not used

TT54263
  • Loading branch information
victoralmau committed Feb 12, 2025
1 parent 99b0587 commit 82b8294
Show file tree
Hide file tree
Showing 32 changed files with 500 additions and 1,892 deletions.
10 changes: 5 additions & 5 deletions rma/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Return Merchandise Authorization Management
: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/17.0/rma
:target: https://github.com/OCA/rma/tree/18.0/rma
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-17-0/rma-17-0-rma
:target: https://translation.odoo-community.org/projects/rma-18-0/rma-18-0-rma
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -150,7 +150,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rma/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20rma%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20rma%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -204,6 +204,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pedrobaeza| |maintainer-chienandalu|

This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/17.0/rma>`_ project on GitHub.
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/18.0/rma>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion rma/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Return Merchandise Authorization Management",
"summary": "Return Merchandise Authorization (RMA)",
"version": "17.0.2.0.0",
"version": "18.0.1.0.0",
"development_status": "Production/Stable",
"category": "RMA",
"website": "https://github.com/OCA/rma",
Expand Down
11 changes: 4 additions & 7 deletions rma/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# Copyright 2022 Tecnativa - Víctor Martínez
# Copyright 2022-2025 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, exceptions, http
Expand All @@ -17,9 +17,7 @@ def _prepare_home_portal_values(self, counters):
if "rma_count" in counters:
rma_model = request.env["rma"]
rma_count = (

Check warning on line 19 in rma/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

rma/controllers/main.py#L18-L19

Added lines #L18 - L19 were not covered by tests
rma_model.search_count([])
if rma_model.check_access_rights("read", raise_exception=False)
else 0
rma_model.search_count([]) if rma_model.has_access("read") else 0
)
values["rma_count"] = rma_count
return values

Check warning on line 23 in rma/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

rma/controllers/main.py#L22-L23

Added lines #L22 - L23 were not covered by tests
Expand All @@ -43,7 +41,7 @@ def portal_my_rmas(self, page=1, date_begin=None, date_end=None, sortby=None, **
values = self._prepare_portal_layout_values()
rma_obj = request.env["rma"]

Check warning on line 42 in rma/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

rma/controllers/main.py#L41-L42

Added lines #L41 - L42 were not covered by tests
# Avoid error if the user does not have access.
if not rma_obj.check_access_rights("read", raise_exception=False):
if not rma_obj.has_access("read"):
return request.redirect("/my")
domain = self._get_filter_domain(kw)
searchbar_sortings = {

Check warning on line 47 in rma/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

rma/controllers/main.py#L45-L47

Added lines #L45 - L47 were not covered by tests
Expand Down Expand Up @@ -137,8 +135,7 @@ def _picking_check_access(self, rma_id, picking_id, access_token=None):
picking = request.env["stock.picking"].browse([picking_id])
picking_sudo = picking.sudo()
try:
picking.check_access_rights("read")
picking.check_access_rule("read")
picking.check_access("read")
except exceptions.AccessError:

Check warning on line 139 in rma/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

rma/controllers/main.py#L134-L139

Added lines #L134 - L139 were not covered by tests
if not access_token or not consteq(rma.access_token, access_token):
raise
Expand Down
243 changes: 0 additions & 243 deletions rma/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -2301,246 +2301,3 @@ msgid ""
msgstr ""
"{{object.company_id.name}} Ihre RMA wurde erfolgreich erstellt (Ref {{object."
"name or 'n/a' }})"

#~ msgid "SMS Delivery error"
#~ msgstr "SMS-Zustellungsfehler"

#~ msgid ""
#~ "<span class=\"fa fa-lg fa-building-o\" title=\"Values set here are "
#~ "company-specific.\" groups=\"base.group_multi_company\"/>"
#~ msgstr ""
#~ "<span class=\"fa fa-lg fa-building-o\" title=\"Diese Werte sind "
#~ "unternehmensspezifisch.\" groups=\"base.group_multi_company\"/>"

#~ msgid "Alias domain"
#~ msgstr "Alias domain"

#~ msgid "Delivered Qty Done"
#~ msgstr "gelieferte Menge Erledigt"

#~ msgid "Last Modified on"
#~ msgstr "Zuletzt geändert am"

#~ msgid "Main Attachment"
#~ msgstr "Hauptanhang"

#~ msgid "Owner"
#~ msgstr "Eigentümer"

#~ msgid "RMA Confirmation Email"
#~ msgstr "RMA-Bestätigungs-E-Mail"

#~ msgid "RMA Manual Finalization"
#~ msgstr "Manueller RMA-Abschluss"

#~ msgid "RMA Receipt Confirmation Email"
#~ msgstr "RMA-Empfangsbestätigungs-E-Mail"

#~ msgid "RMA draft notification Email"
#~ msgstr "Benachrichtigungs-E-Mail zum RMA-Entwurf"

#~ msgid "Remaining delivered qty to done"
#~ msgstr "Verbleibende Liefermenge zu erledigen"

#~ 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 ""
#~ "Der Eigentümer von Datensätzen, die beim Empfang von E-Mails unter diesem "
#~ "Alias erstellt wurden. Wenn dieses Feld nicht gesetzt ist, versucht das "
#~ "System, den richtigen Eigentümer anhand der Absenderadresse (Von) zu "
#~ "finden, oder verwendet das Administratorkonto, wenn kein Systembenutzer "
#~ "für diese Adresse gefunden wird."

#~ msgid ""
#~ "When the RMA is receive, allow to finsish it manually choosing\n"
#~ " a finalization reason."
#~ msgstr ""
#~ "Wenn die RMA eingegangen ist, können Sie sie manuell abschließen, \n"
#~ " indem Sie einen Abschlussgrund auswählen."

#~ msgid "{{(object.name or '')}}"
#~ msgstr "{{(object.name or '')}}"

#~ msgid ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"margin: 0px; padding: 0px; font-size: 13px;"
#~ "\">\n"
#~ " Dear\n"
#~ " <t t-out=\"object.partner_id.name\"/>\n"
#~ " <t t-if=\"object.partner_id.parent_id\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\"/>\n"
#~ " </t>\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " Here is the RMA\n"
#~ " <strong>\n"
#~ " <t t-out=\"object.name\"/>\n"
#~ " </strong>\n"
#~ " from\n"
#~ " <t t-out=\"object.company_id.name\"/>\n"
#~ " .\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " Do not hesitate to contact us if you have any "
#~ "question.\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "
#~ msgstr ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"box-sizing:border-box;margin: 0px; padding: "
#~ "0px; font-size: 13px;\">\n"
#~ " Sehr geehrte/r\n"
#~ " <t t-out=\"object.partner_id.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " <t t-if=\"object.partner_id.parent_id\" data-oe-t-"
#~ "group-active=\"true\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\" "
#~ "data-oe-t-inline=\"true\"></t>\n"
#~ " </t>\n"
#~ " <br>\n"
#~ " <br>\n"
#~ " Hiermit übermitteln wie Ihnen unseren RMA Auftrag\n"
#~ " <strong style=\"box-sizing:border-box;font-weight:500;"
#~ "\">\n"
#~ " <t t-out=\"object.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " </strong>\n"
#~ " von\n"
#~ " <t t-out=\"object.company_id.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " .\n"
#~ " <br>\n"
#~ " <br>\n"
#~ " Zögern Sie nicht uns zu kontaktieren.\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "

#~ msgid ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"margin: 0px; padding: 0px; font-size: 13px;"
#~ "\">\n"
#~ " Dear\n"
#~ " <t t-out=\"object.partner_id.name\"/>\n"
#~ " <t t-if=\"object.partner_id.parent_id\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\"/>\n"
#~ " </t>\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " The products for your RMA\n"
#~ " <strong>\n"
#~ " <t t-out=\"object.name\"/>\n"
#~ " </strong>\n"
#~ " from\n"
#~ " <t t-out=\"object.company_id.name\"/>\n"
#~ " have been received in our warehouse.\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " Do not hesitate to contact us if you have any "
#~ "question.\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "
#~ msgstr ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"margin: 0px; padding: 0px; font-size: 13px;"
#~ "\">\n"
#~ " Sehr geehrte/r\n"
#~ " <t t-out=\"object.partner_id.name\"/>\n"
#~ " <t t-if=\"object.partner_id.parent_id\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\"/>\n"
#~ " </t>\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ "Die Produkte für ihren RMA\n"
#~ " <strong>\n"
#~ " <t t-out=\"object.name\"/>\n"
#~ " </strong>\n"
#~ " von\n"
#~ " <t t-out=\"object.company_id.name\"/>\n"
#~ "wurden in unserem Lager erfolgreich entgegen genommen.\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " Zögern Sie nicht uns bei weiteren Fragen erneut zu "
#~ "kontaktieren\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "

#~ msgid ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"margin: 0px; padding: 0px; font-size: 13px;"
#~ "\">\n"
#~ " Dear\n"
#~ " <t t-out=\"object.partner_id.name\"/>\n"
#~ " <t t-if=\"object.partner_id.parent_id\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\"/>\n"
#~ " </t>\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " You've succesfully placed your RMA\n"
#~ " <strong>\n"
#~ " <t t-out=\"object.name\"/>\n"
#~ " </strong>\n"
#~ " on\n"
#~ " <t t-out=\"object.company_id.name\"/>\n"
#~ " . Our team will check it and will validate it as soon "
#~ "as possible.\n"
#~ " <br/>\n"
#~ " <br/>\n"
#~ " Do not hesitate to contact us if you have any "
#~ "question.\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "
#~ msgstr ""
#~ "<div style=\"margin: 0px; padding: 0px;\">\n"
#~ " <p style=\"box-sizing:border-box;margin: 0px; padding: "
#~ "0px; font-size: 13px;\">\n"
#~ " Sehr geehrte/r\n"
#~ " <t t-out=\"object.partner_id.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " <t t-if=\"object.partner_id.parent_id\" data-oe-t-"
#~ "group-active=\"true\">\n"
#~ " <t t-out=\"object.partner_id.parent_id.name\" "
#~ "data-oe-t-inline=\"true\"></t>\n"
#~ " </t>\n"
#~ " <br>\n"
#~ " <br>\n"
#~ " Sie haben erfolgreich ihren Reklamationsauftrag "
#~ "eingebracht.\n"
#~ " <strong style=\"box-sizing:border-box;font-weight:500;"
#~ "\">\n"
#~ " <t t-out=\"object.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " </strong>\n"
#~ " für\n"
#~ " <t t-out=\"object.company_id.name\" data-oe-t-"
#~ "inline=\"true\"></t>\n"
#~ " . Unser Team wird die Anfrage bearbeiten uns sich so "
#~ "bald wie möglich bei Ihnen melden.\n"
#~ " <br>\n"
#~ " <br>\n"
#~ "Zögern Sie nicht uns bei weiteren Fragen erneut zu kontaktieren\n"
#~ " </p>\n"
#~ " </div>\n"
#~ " "

#~ msgid "Number of messages which requires an action"
#~ msgstr "Anzahl der Nachrichten, die eine Aktion erfordern"

#~ msgid "Number of unread messages"
#~ msgstr "Anzahl der ungelesenen Nachrichten"

#~ msgid "Unread Messages"
#~ msgstr "ungelesene Nachrichten"

#~ msgid "Unread Messages Counter"
#~ msgstr "Zähler für ungelesene Nachrichten"

#~ msgid "Users"
#~ msgstr "Benutzer"
Loading

0 comments on commit 82b8294

Please sign in to comment.