Page 2 of 3

Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Nov 17, 2021 9:59 am
by Terence

There is a ticket open for this, we changed the calendar setting to 24 hours calendars default. On project level you can set the business calendar.

https://github.com/bryntum/odoo-support/issues/1


Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Nov 17, 2021 10:14 am
by Terence

To hot fix it, you could change it back in controllers.py

Search for the function def gantt_calendar(self):

and change the old calendar setting back

 [
            {
                "id": "general",
                "name": "General",
                "intervals": [
                    {
                        "recurrentStartDate": "on Sat at 0:00",
                        "recurrentEndDate": "on Mon at 0:00",
                        "isWorking": False
                    }
                ],
                "expanded": True,
                "children": [
                    {
                        "id": "business",
                        "name": "Business",
                        "hoursPerDay": 8,
                        "daysPerWeek": 5,
                        "daysPerMonth": 20,
                        "intervals": [
                            {
                                "recurrentStartDate": "every weekday at 12:00",
                                "recurrentEndDate": "every weekday at 13:00",
                                "isWorking": False
                            },
                            {
                                "recurrentStartDate": "every weekday at 17:00",
                                "recurrentEndDate": "every weekday at 08:00",
                                "isWorking": False
                            }
                        ]
                    },
                    {
                        "id": "night",
                        "name": "Night shift",
                        "hoursPerDay": 8,
                        "daysPerWeek": 5,
                        "daysPerMonth": 20,
                        "intervals": [
                            {
                                "recurrentStartDate": "every weekday at 6:00",
                                "recurrentEndDate": "every weekday at 22:00",
                                "isWorking": False
                            }
                        ]
                    }
                ]
            }
        ]

Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Nov 17, 2021 10:23 am
by janverstr

Thanks for the hot fix. I'll test it right away.

Changing the meaning of the duration (5/7 or 7/7) has a large impact on the planning of existing projects. It is a pity that the 24/7 calendar replaced the default calendar instead of being added as another calendar.

There is an issue with the duration in the business calendar too. If I specify the duration of a task as 2 days, then that is calculated as 48 hours. Which then is translated back to 6 working days of 8 hours. This causes that a task with a duration of 2 days, which starts at November 1st, ends on November 8th only. This is very contra-intuitive.

How do you set the calendar on a project level?


Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Nov 17, 2021 10:53 am
by Terence

You can set it on one of the root tasks.

We will add the calendar configurations in the project settings in the upcoming iteration. That will make it flexible. The calendar configuration is currently statically returned and we changed that into a 24 hour calendar.

If you set the old configuration back meanwhile, you will have the old situation with a default 5 day week calendar


Re: how to change calendar in gantt for odoo to weekdays

Posted: Mon Apr 04, 2022 7:02 pm
by janverstr

Hey,

For some reason I cannot have weekends as non-working time anymore. I tried a lot of things in the settings page already (where the calendar config is now), but even a literal copy-paste of the above suggestion, does not highlight weekends (option is on) nor does it stretch tasks over the borders of the weekend.

Version (for now) 14.0.1.3.3


Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Apr 06, 2022 2:52 pm
by janverstr

Solved it by applying the same hotfix directly in the code instead of in the settings.
Apparently the settings field is not read in 14.0.1.3.3, because when I removed two out of the three calendars, the three calendars were still available in the gantt chart


Re: how to change calendar in gantt for odoo to weekdays

Posted: Wed Apr 06, 2022 6:07 pm
by janverstr

I was happy too soon.
I can indeed exclude weekends, but still duration does not behave how it should.

Setting: hoursperday=8, daysperweek=5, weekenddays excluded in interval, working days: 8-12 and 13-17 = 8h
Desire:
Duration 2 days: start monday, end tuesday EOB
Duration 16 hours: same = start monday, end tuesday EOB (8h/day --> 16h = 2days)
Duration 1 week: start tuesday, end monday EOB (5d/week --> 1w = 5days)

Actual, wrong behaviour:
Duration 2 days: start monday, end monday EOB week after (2x24 = 48hours, divided by 8 (8-12&13-17) = 6 days)
Duration 1 week: same erroneous behavior: start monday, end monday EOB 5 weeks later (7x24 = 168, divided by 8hours/day = 21 days)

It seems as if the parameters daysperweek, hoursperday etc are completely ignored.
This also not working correctly in the demo, when selecting the business or night shift calendars. 1 week is not 1 week.


Re: how to change calendar in gantt for odoo to weekdays

Posted: Mon Apr 11, 2022 9:21 am
by janverstr

Any update on this?
I got a mail that there was an answer in the forum, but it seems to removed.


Re: how to change calendar in gantt for odoo to weekdays

Posted: Mon Apr 11, 2022 5:03 pm
by Terence

Strange, I posted we found the cause and that I make a config option for it.

https://github.com/bryntum/odoo-support/issues/70


Re: how to change calendar in gantt for odoo to weekdays

Posted: Mon Apr 25, 2022 4:57 pm
by Terence

The config option will be in the settings page 'Gantt configuration object' in release 1.3.4. Available tomorrow.

Like

{
 project : {
 		hoursPerDay : 8,
 		daysPerDay : 8
 	}
}