Files
Odoo-Modules/fusion_claims/static/src/js/calendar_store_hours.js
2026-02-22 01:22:18 -05:00

23 lines
759 B
JavaScript

/** @odoo-module **/
// Fusion Claims - Calendar Store Hours Restriction
// Copyright 2024-2026 Nexa Systems Inc.
// License OPL-1
//
// Restricts the technician task calendar view to only show store hours.
// Default: 9:00 AM - 6:00 PM (configurable in Settings).
import { patch } from "@web/core/utils/patch";
import { CalendarRenderer } from "@web/views/calendar/calendar_renderer";
patch(CalendarRenderer.prototype, {
get fcOptions() {
const options = super.fcOptions;
// Only restrict hours for the technician task calendar
if (this.props.model?.resModel === "fusion.technician.task") {
options.slotMinTime = "08:00:00";
options.slotMaxTime = "19:00:00";
}
return options;
},
});