콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3729 화면

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...

아바타
취소
작성자

Anyone that can help me out?

Have you found a working solution, Robert?

베스트 답변

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.

아바타
취소
관련 게시물 답글 화면 활동
1
7월 25
625
2
6월 25
1018
1
5월 25
2554
3
8월 24
2787
0
12월 23
1863