Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0] [IMP] resource: increase limit of plan_days computation #61

Open
wants to merge 1 commit into
base: 13.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/resource/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def plan_days(self, days, day_dt, compute_leaves=False, domain=None):
if days > 0:
found = set()
delta = timedelta(days=14)
for n in range(100):
for n in range(1000):
dt = day_dt + delta * n
for start, stop, meta in get_intervals(dt, dt + delta):
found.add(start.date())
Expand All @@ -667,7 +667,7 @@ def plan_days(self, days, day_dt, compute_leaves=False, domain=None):
days = abs(days)
found = set()
delta = timedelta(days=14)
for n in range(100):
for n in range(1000):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThomasBinsfeld Maybe a config parameter should be more convenient, no ?

Copy link
Member Author

@ThomasBinsfeld ThomasBinsfeld May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or a while(True) and let it compute as long as the CPU limit allows it. A range is an arbitrary limit anyway. And a parameter would be a very technical one.

dt = day_dt - delta * n
for start, stop, meta in reversed(get_intervals(dt - delta, dt)):
found.add(start.date())
Expand Down