Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3830 Vistas

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
Descartar
Autor

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!

Mejor respuesta
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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 19
6810
1
may 21
2504
1
jul 20
4892
1
sept 22
10332
0
ago 19
2878