Initial commit
This commit is contained in:
22
fusion_claims/static/src/js/calendar_store_hours.js
Normal file
22
fusion_claims/static/src/js/calendar_store_hours.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/** @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;
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user