Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/* Copyright 2023 Tecnativa - Stefan Ungureanu
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
import {CalendarCommonRenderer} from "@web/views/calendar/calendar_common/calendar_common_renderer";
import {patch} from "@web/core/utils/patch";
patch(CalendarCommonRenderer.prototype, {
get options() {
const options = super.options;
if (this.env.searchModel.context.calendar_slot_duration) {
options.slotDuration = this.env.searchModel.context.calendar_slot_duration;
}
return options;
},
});

View File

@@ -0,0 +1,24 @@
/* Copyright 2023 Tecnativa - Stefan Ungureanu
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
import {CalendarModel} from "@web/views/calendar/calendar_model";
import {patch} from "@web/core/utils/patch";
patch(CalendarModel.prototype, {
buildRawRecord(partialRecord, options = {}) {
if (
!partialRecord.end &&
this.env.searchModel.context.calendar_slot_duration &&
!partialRecord.isAllDay
) {
const slot_duration = this.env.searchModel.context.calendar_slot_duration;
const [hours, minutes, seconds] = slot_duration
.match(/(\d+):(\d+):(\d+)/)
.slice(1, 4);
const durationFloat = hours + minutes / 60 + seconds / 3600;
partialRecord.end = partialRecord.start.plus({hours: durationFloat});
}
return super.buildRawRecord(partialRecord, options);
},
});