How to change Calendarview minTime/maxTime/slotDuration?

Asked

Viewed 32 times

0

I need to change: Slotduration to '00:10:00', minTime to '08:00:00, and maxTime to '22:00:00' without touching the original code

call_calendar_change.xml

<odoo>
<template id="assets_backend name="assets_backend_new" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/anser_ricardo/static/src/js/change_calendar.js"></script>
</xpath>
</template>
</odoo>

change_calendar.js

odoo.define('anser_ricardo.call_calendar_change', function(require){
"use strict";
var CalendarView = require('web.CalendarView');
CalenderView.include({
minTime: '08:00:00'
maxTime: '22:00:00'
slotDuration: '00:10:00'
})
});

But what I have doesn’t work, I think the problem is no.js, can anyone help me? Thanks!

1 answer

0


Here is the solution:

odoo.define('anser_ricardo', function (require) {
"use strict";

var CalendarModel = require('web.CalendarModel');

CalendarModel.include({
    _getFullCalendarOptions: function () {
        var res = this._super.apply(this, arguments);
        return _.extend(res, {
            minTime: '08:00:00',
            maxTime: '22:00:00',
            slotDuration: '00:10:00',
        });
    },
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.