Skip to Content
Menu
This question has been flagged
1668 Views

Hello, 

I am trying to add background events to Odoo calendar. The background events should be shown only when one participant is selected. 
To get the data for the participant I am calling python method in the .js script. 
This is done using rpc.query :

          rpc.query({
model:'hr.employee',
method:'get_employee_working_hours',
args: [[],employee_id],
}).then(function(result){
var events = result;

events.forEach(function(item){

//create background events
calendar_events.push(item)
console.log(item)
}
)
});

When I am adding events manually they are shown in the calendar. The result of the method is ok. The problem is that I can see the events in console.log but they are not shown in the calendar. 

I guess that rpc.query is the problem. 
Does anyone knows how to call a python method into JavaScript without using rpc.query?


Avatar
Discard

Did you find a solution for this? I want to add background events but all appears as regular events