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

[FIX] fieldservice: edge-case NoneType + datetime.timedelta #1121

Closed
wants to merge 1 commit into from

Conversation

PicchiSeba
Copy link

@PicchiSeba PicchiSeba commented Oct 10, 2023

We discovered a problem were sometimes, in a few rare scenarios, the line date_to_with_delta = start_date + timedelta(hours=hours) in the function _calc_scheduled_dates(self, vals) fails because start_date's value is None.

In order to solve this issue I added a simple check and a log call to see where the problem lies.

But I just can't explain why that variable ended up with such a value in the first place. That would mean both vals["scheduled_date_start"] and start_date_val had a falsy value and still it shouldn't be possible.

If anyone can see what exactly the problem is I would gladly fix it in a proper way.

@OCA-git-bot
Copy link
Contributor

Hi @wolfhall, @max3903,
some modules you are maintaining are being modified, check this out!

@PicchiSeba PicchiSeba force-pushed the 14.0-fix-duplicate-date-err branch 5 times, most recently from 820190c to 7e77896 Compare October 10, 2023 13:01
@PicchiSeba PicchiSeba marked this pull request as ready for review October 10, 2023 13:15
@max3903 max3903 added this to the 14.0 milestone Oct 10, 2023
@max3903 max3903 self-assigned this Oct 10, 2023
@PicchiSeba PicchiSeba closed this Oct 12, 2023
@PicchiSeba PicchiSeba deleted the 14.0-fix-duplicate-date-err branch October 24, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants