Skip to Content
Menu
This question has been flagged
1 Reply
2896 Views

I need to modify: SlotDuration to '00:10:00', minTime to '08:00:00' and maxTime to '22:00:00' without messing with the original code

from what i've seen i need .js with the changes i want to make and .xml to put it in assets_backend

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', 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 clearly doesn't work, i think the problem is in .js file, can anyone help me? I saw 2/3 people with the same question as me, but no answer. Thanks!


Avatar
Discard
Author

Perfect! Thank you so much @Jigar Patel, you are the best! i can't vote because i don't have enough karma but as soon i get 5 karma i will vote! Is there a way to define minTime/maxTime/slotDuration in odoo System Parameters and then java will get those values and set Calendar to it? Once again, thank you so much!

Best Answer
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',
});
},
});
Avatar
Discard
Related Posts Replies Views Activity
1
Jul 19
5748
1
May 21
1768
1
Jul 20
3817
1
Sep 22
9231
0
Aug 19
1889