fix: populate payment schedule from payment terms (backport #44082) #44083
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.
Version: 15 and 14
fixes: #44039
Before:
The code checked if
is_return
was exactly0
with this condition:This would only work if
is_return
was set to0
. Ifis_return
wasn't available or set to something else, the condition wouldn't trigger, and the payment schedule wouldn't populate.After:
The code was changed to:
This condition checks if
is_return
is either not set or has a falsy value (like0
,null
, orundefined
). So, even ifis_return
is missing in some doctypes, the payment schedule will still auto-populate.is_return
field is not available in certain documents. The new check ensures the payment schedule populates correctly even whenis_return
is not set.This is an automatic backport of pull request fix: populate payment schedule from payment terms #44082 done by Mergify.