[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
This commit is contained in:
Arnaud Joset
2022-09-28 20:29:51 +02:00
committed by William Braeckman
parent 5b0fc11639
commit e34a9322b4
@@ -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);