Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
7133 Представления

When I have a date field for birthdays, and show it on a calendar, only the "real" birthday, the first, is shown.

How do I make the calendar view show it every year?

Аватар
Отменить
Лучший ответ

You can use a cron task that run every year with some code like this:

for employee in employees :
    date.month=birthday.month
    date.day=birthday.day
    duration=1 day
    create meeting(date,duration)

translate this in correct python

Аватар
Отменить
Автор

I know how I could add meetings to a given calender, but I'm asking for the calendar _view_ of OpenERP. In order to have it shown there, I would have to add a new data record for every year to my live data, as far as I can see. And it would then appear on tree and form views, too?

Sorry, I don't feel this answers my question.

With a cron like this, every year an action will create a meeting to all your employees birthday. Their meetings will appear on tree and form view too. Do you have a calendar view with your employees model? In this case I thing you can not do that because calendar view show one "event" per data, you can not have "multi-event" per data like you want. Maybe you can create an Birthday model object with a special calendar view for this.

Автор

Ok, I added a new model for this and added dates covering the estimated lifespan * 1.5 :), so it is a workaround for now. I'll see if I can prepare a blueprint or more for reoccurrence on the "real" calendar view.

Related Posts Ответы Просмотры Активность
1
февр. 23
7106
0
мар. 15
7553
1
мар. 15
6837
1
мар. 15
9792
1
мар. 15
5720