Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
6981 Lượt xem

I'm looking for the code that sets the 'Everybody's calendars' boolean to false in the Calendar app so I can change it to true.  

I know altering the source code directly is not recommended practice and that I'll need to remember to change it again after every Odoo update, but I need everyone to be able to see all calendar events and I can't find any other way to change that default setting.  It's particularly important because on an iphone, the responsive calendar view does not display the tick boxes so users cannot change it manually. Requesting the desktop site on an iphone does not seem to work either.

It used to be in addons/calendar/static/src/js/ but I gather it's moved and I can't find it.



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Bill,

It is done in the function "_loadFilter" in web/static/src/js/views/calendar/calendar_model.js.
You can find the code that does the active checks and setting the calendar definitions at https://github.com/odoo/odoo/blob/11.0/addons/web/static/src/js/views/calendar/calendar_model.js#L465-L521

Regards,
Yenthe

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Yenthe. Any idea what would need to be changed to have 'Everybody's calendars' selected by default? Or even if it's possible?

is it possible to have everybody's calendar check by default? if so, how do you do it? Thanks

Tác giả

Hi Rick. I tried a bunch of changes to the file Yenthe mentioned above but I didn't really know what I was doing and was not successful. If you have any luck, please let me know.

Câu trả lời hay nhất

Hello Bill,

In Odoo 17, the function "makeFilterAll" is the one that adds the "all" filter
https://github.com/odoo/odoo/blob/128475bf2ac966f98f488833e5ff781312055b76/addons/web/static/src/views/calendar/calendar_model.js#L835

you need to change this line https://github.com/odoo/odoo/blob/128475bf2ac966f98f488833e5ff781312055b76/addons/web/static/src/views/calendar/calendar_model.js#L841

from "active: previousAllFilter ? previousAllFilter.active : false,"
To: "active: previousAllFilter ? previousAllFilter.active : true,"

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Is there any update to this? This would be really useful!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
9102
2
thg 9 21
7482
5
thg 4 21
6713
1
thg 9 20
6891
2
thg 9 18
3418