From 3873bae6514a2ab85af4cfda4ae20c3a68bd5a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=8E=E3=82=A6=E3=83=A9?= Date: Wed, 4 Jan 2023 23:24:44 +0000 Subject: [PATCH] [FIX] stock: fix js traceback when selecting all locations Steps to reproduce: - Install stock - Activate storage locations - Switch to French language - Go to stock/analyse/emplacements - Select all locations A javascript traceback pops up because the names 'Set' and 'Count Sheet' are not translated, therefore we use _t function to translate the terms. opw-3113275 closes odoo/odoo#109261 X-original-commit: 719a6e6223bbde3cdeb0ade5665d95681c436521 Signed-off-by: Tiffany Chang --- addons/stock/i18n/stock.pot | 6 ++++++ .../src/views/list/inventory_report_list_controller.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 8d93df69184..732851ea9d3 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -1667,7 +1667,10 @@ msgid "Count Picking Waiting" msgstr "" #. module: stock +#. odoo-javascript +#: code:addons/stock/static/src/views/list/inventory_report_list_controller.js:0 #: model:ir.actions.report,name:stock.action_report_inventory +#, python-format msgid "Count Sheet" msgstr "" @@ -6928,8 +6931,11 @@ msgid "" msgstr "" #. module: stock +#. odoo-javascript +#: code:addons/stock/static/src/views/list/inventory_report_list_controller.js:0 #: model:ir.actions.server,name:stock.action_view_set_quants_tree #: model_terms:ir.ui.view,arch_db:stock.view_stock_quant_tree_inventory_editable +#, python-format msgid "Set" msgstr "" diff --git a/addons/stock/static/src/views/list/inventory_report_list_controller.js b/addons/stock/static/src/views/list/inventory_report_list_controller.js index d1043572a76..abd97615884 100644 --- a/addons/stock/static/src/views/list/inventory_report_list_controller.js +++ b/addons/stock/static/src/views/list/inventory_report_list_controller.js @@ -21,8 +21,8 @@ export class InventoryReportListController extends ListController { // hack so we don't show some of the default actions when it's inappropriate to const { print, action } = actionMenus; return { - action: action.filter((a) => a.name !== "Set"), - print: print.filter((a) => a.name !== "Count Sheet"), + action: action.filter((a) => a.name !== this.env._t("Set")), + print: print.filter((a) => a.name !== this.env._t("Count Sheet")), }; } return actionMenus;