[FIX] web_calendar_slot_duration: finish migration

pull/3084/head
David 2023-10-31 17:52:06 +01:00 committed by Christopher Rogos
parent 084c67a07a
commit 2d8b02f9a8
2 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"

View File

@ -10,10 +10,12 @@ patch(CalendarModel.prototype, "WebCalendarSlotDurationCalendarModel", {
buildRawRecord(partialRecord, options = {}) {
if (
this.env.searchModel.context.calendar_slot_duration &&
partialRecord.isAllDay != true
!partialRecord.isAllDay
) {
const slot_duration = this.env.searchModel.context.calendar_slot_duration;
const [hours, minutes, seconds] = slot_duration.match(/(\d+):(\d+):(\d+)/);
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});
}