From e34a9322b4727f3eded80a311072ba80ba94002c Mon Sep 17 00:00:00 2001 From: Arnaud Joset Date: Tue, 27 Sep 2022 12:47:13 +0000 Subject: [PATCH] [FIX] web: fix missing labels for week_days widget If the day fields are missing from the fields in the view the labels are not loaded. This commit adds default labels to the fields to avoid them being empty. TaskId-2999194 X-original-commit: c6f8a229e9a8bcb798dc2944185fc48c3c871025 Part-of: odoo/odoo#101492 --- .../src/views/widgets/week_days/week_days.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/views/widgets/week_days/week_days.js b/addons/web/static/src/views/widgets/week_days/week_days.js index 609e287fbe5..56e51dc1d1b 100644 --- a/addons/web/static/src/views/widgets/week_days/week_days.js +++ b/addons/web/static/src/views/widgets/week_days/week_days.js @@ -3,6 +3,7 @@ import { registry } from "@web/core/registry"; import { CheckBox } from "@web/core/checkbox/checkbox"; import { localization } from "@web/core/l10n/localization"; +import { _lt } from "@web/core/l10n/translation"; const { Component } = owl; @@ -28,13 +29,13 @@ WeekDays.template = "web.WeekDays"; WeekDays.components = { CheckBox }; WeekDays.fieldDependencies = { - sun: { type: "boolean" }, - mon: { type: "boolean" }, - tue: { type: "boolean" }, - wed: { type: "boolean" }, - thu: { type: "boolean" }, - fri: { type: "boolean" }, - sat: { type: "boolean" }, + sun: { type: "boolean", string: _lt("Sun") }, + mon: { type: "boolean", string: _lt("Mon") }, + tue: { type: "boolean", string: _lt("Tue") }, + wed: { type: "boolean", string: _lt("Wed") }, + thu: { type: "boolean", string: _lt("Thu") }, + fri: { type: "boolean", string: _lt("Fri") }, + sat: { type: "boolean", string: _lt("Sat") }, }; registry.category("view_widgets").add("week_days", WeekDays);