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

Hello there,


We make use of the calendar, with the Google sync as well for the managers...


Is there anyone who can tell me how to do the following;


I want to have a team of managers to be able to view the calendars of all users

Meanwhile the "normal" employees should only be able to see their own calendar of appointments in the calendar for which they are invited... So they shouldn't be able to filter on "everybody's calendar" and they shouldn't be able to add anyone from te managers group to their calendar view...


I tried to play with the record rules and acces rights but i broke our local installation several times doing so. On Google i just don't get any further. Is this even possible?

Anyone who can help me out? We are using Odoo 16 community edition.


Thanks in advance...

Avatar
Descartar
Autor

Anyone that can help me out?

Have you found a working solution, Robert?

Mejor respuesta

Assuming you are working in Odoo version 18.

Go to server_v18/addons/web/static/src/views/calendar/calendar_model.js

Find this block inside the loadFilterSection method:

const previousAllFilter = previousFilters.find((f) => f.type === "all");

filters.push(this.makeFilterAll(previousAllFilter, isUserOrPartner, filterInfo.label));

Replace it with:

const previousAllFilter = previousFilters.find((f) => f.type === "all");

// Check group before adding the "Everybody's calendars" filter
let shouldShowAllFilter = true;

if (isUserOrPartner) {
    shouldShowAllFilter = await user.hasGroup("your_module.group_everybody_calendar");
}

if (shouldShowAllFilter) {
    const allFilter = this.makeFilterAll(previousAllFilter, isUserOrPartner, filterInfo.label);
    if (allFilter) {
        filters.push(allFilter);
    }
}

Now only if the user is the memer of this group (e.g. "your_module_name.group_everybody_calendar"), then only this filter "Everybody's calendars" will be visible to them.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
118
2
jun 25
604
1
may 25
2274
3
ago 24
2483
0
dic 23
1688