0
Is there any way to define Fullcalendar minTime/maxTime/slotDuration in the odoo system parameters and then with java call these values and implement in the calendar? i.e. Define 3 System Parameters (Starttime, Stoptime and Slotduration) and call these values.
I have this: (Thanks to @Jigar Patel)
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',
});
},
});
});
And I created 3 parameters:
<record id='start_time_key' model='ir.config_parameter'>
<field name='key'>start_time_key</field>
<field name='value'>08:00:00</field>
</record>
<record id='stop_time_key' model='ir.config_parameter'>
<field name='key'>stop_time_key</field>
<field name='value'>22:00:00</field>
</record>
<record id='slotDuration_time_key' model='ir.config_parameter'>
<field name='key'>slotDuration_time_key</field>
<field name='value'>00:10:00</field>
</record>
I need to receive these values for minTime/maxTime/slotDuration, and not set them directly in the code. Something like this:
return _.extend(res, {
minTime: get.start_time_key,
maxTime: get.stop_time_key,
slotDuration: get.slotDuration_time_key,
Can anyone help me? Thank you!
I use via ajax and return pro fullcalendar.
– Lucas Antonio