تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
6 الردود
5312 أدوات العرض

I want to show the public holiday include in a periode of a project in the timeline view of the project dashboard,

First I got the list of holidays include in each project, here my function:

@api.depends('date_start', 'date')
def get_holiday(self):

    if self.resource_calendar_id:
        for leave_ids in self.env['resource.calendar.leaves'].search([
                                                            ('calendar_id', '=', self.resource_calendar_id.name),
                                                            ]):

                # datetime to date
                date_from = leave_ids.date_from.date()
                date_to = leave_ids.date_to.date()

                Range = namedtuple('Range', ['start', 'end'])

                r1 = Range(start=self.date_start, end=self.date)
                r2 = Range(start=date_from, end=date_to)

                latest_start = max(r1.start, r2.start)
                earliest_end = min(r1.end, r2.end)

                overlap = (earliest_end - latest_start).days + 1
                overlapping_dates = []

                if overlap > 0:

                    overlapping_dates = range(latest_start.toordinal(), earliest_end.toordinal() + 1)

                    overlapping_dates = [date.fromordinal(x) for x in overlapping_dates]

Now i've to call my function from javascript to show the result(public holiday) in the timeline view with deferent colors, How can i do that ?

Exemple: 01/01/2020 is public holiday, like this:


الصورة الرمزية
إهمال

Check that link may be it can help you

odoo.com/forum/help-1/question/how-to-assign-a-color-to-a-person-in-calendar-14054

أفضل إجابة

Hello Ravi

just install \https://apps.odoo.com/apps/modules/12.0/web_timeline/

الصورة الرمزية
إهمال
أفضل إجابة

Check that link may be it can help you

الصورة الرمزية
إهمال
الكاتب

which link

أفضل إجابة

is it Gantt view or activity view?

الصورة الرمزية
إهمال
الكاتب

Gantt / timekine view in project dashboard

sorry but I am still struggling to find the provided view(screenshot). can you provide the step to reach there on http://runbot.odoo.com/runbot

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 24
6864
1
أكتوبر 22
24556
2
سبتمبر 21
13327
1
أغسطس 21
8762
1
يوليو 21
4681