[FW][FIX] resource: prevent traceback with false start date #163311
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This traceback arises when the user tries to remove the
start date
Steps to produce
resource
Settings/Technical/resource/Resource Time Off
start date
Error:
when the user tries to remove the start date, an error will be produced because _compute_date_to seems to be computing the date_to based on the date_from field. when removing the
date_from
from calculations on empty or nonewhich leads to traceback from here
odoo/addons/resource/models/resource_calendar_leaves.py
Lines 54 to 59 in 322e7ea
This PR solves the above issue by computing
date_to
for records that havedate_from
. Apart from that, this PR also removes# -*- coding: utf-8 -*-
from the first line of the modified file.
sentry-4983497879
Forward-Port-Of: #163136
Forward-Port-Of: #154555