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: use CombineDatetime instead of Timestamp in QB queries #34895

Merged
merged 4 commits into from
Apr 19, 2023

Conversation

s-aga-r
Copy link
Contributor

@s-aga-r s-aga-r commented Apr 17, 2023

Change Timestamp to CombineDatetime for queries written in frappe.qb.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Apr 17, 2023
@s-aga-r s-aga-r removed the needs-tests This PR needs automated unit-tests. label Apr 17, 2023
@@ -192,7 +192,7 @@ def get_batch_qty(
posting_time = nowtime()

query = query.where(
Timestamp(sle.posting_date, sle.posting_time) <= Timestamp(posting_date, posting_time)
UnixTimestamp(sle.posting_date, sle.posting_time) <= UnixTimestamp(posting_date, posting_time)
Copy link
Member

@ankush ankush Apr 18, 2023

Choose a reason for hiding this comment

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

CombineDatetime is what you're looking for not unix timestamp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ankush Is there any difference between sql timestamp and frappe.qb UnixTimestamp? As we are using sql timestamp in most of the queries.

@s-aga-r s-aga-r changed the title chore: use UnixTimestamp instead of Timestamp in QB queries fix: use CombineDatetime instead of Timestamp in QB queries Apr 18, 2023
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #34895 (6519514) into develop (59f3fed) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #34895   +/-   ##
========================================
  Coverage    63.87%   63.87%           
========================================
  Files          810      810           
  Lines        59746    59746           
========================================
+ Hits         38162    38163    +1     
+ Misses       21584    21583    -1     
Impacted Files Coverage Δ
erpnext/stock/doctype/batch/batch.py 83.33% <100.00%> (ø)
...stock_value_report/incorrect_stock_value_report.py 56.25% <100.00%> (ø)

... and 1 file with indirect coverage changes

@s-aga-r s-aga-r added the backport version-14-hotfix backport to version 14 label Apr 19, 2023
@s-aga-r s-aga-r marked this pull request as ready for review April 19, 2023 13:23
@s-aga-r s-aga-r merged commit daac4dc into frappe:develop Apr 19, 2023
s-aga-r added a commit that referenced this pull request Apr 20, 2023
…-34895

fix: use `CombineDatetime` instead of `Timestamp` in QB queries (backport #34895)
@s-aga-r s-aga-r removed the backport version-14-hotfix backport to version 14 label Apr 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants