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
[12.0][FIX] account_budget_oca: fix date format in psql query #26
[12.0][FIX] account_budget_oca: fix date format in psql query #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revised and tested
AND (date between to_date(%s,'yyyy-mm-dd') | ||
AND to_date(%s,'yyyy-mm-dd')) | ||
AND (date between %s | ||
AND %s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at these lines it seems that wizard_date_from
and wizard_date_to
are expected to be strings. In this case the to_date()
is still necessary.
I think you should keep the to_date()
and convert the line.date_from
and line.date_to
to string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another solution would be to remove all the occurrences of wizard_date_from
and wizard_date_to
. It seems they are not used, probably they are a leftover from old code. This way you could keep your solution that removes the to_date()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it looks like wizard_date_from
and wizard_date_to
are unused... I didn't search where that codes come from...
By the way the aim of this PR is that to_date
function does not exist anymore in Postgresql since... v9.6 ? v10.0 ?
(in our case v10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then! Let's go with the fix you proposed. But please remove all the occurrences of wizard_date_from
and wizard_date_to
because they are not used in the code and in any case they would not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, on our side we use the PR in production @AStripe fell free to override it if you think code should be cleaned up... sorry did not have time to go further on that one |
@cvinh Is not just a matter of cleaning up. After your fix, the part of code I was mentioning ( |
I see... let me do that changes... it's not that big |
Thanks @cvinh, I look forward to test and review once you submit the update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, tested and works great.
Can this one be merged? |
Merging blindly according reviews /ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 2f03602. Thanks a lot for contributing to OCA. ❤️ |
Before that fix, we have an error in the query (to_date function does not exist anymore in psql) when we add a budget line and save it