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

refactor: stock balance report #30677

Merged
merged 9 commits into from
Apr 14, 2022
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Apr 11, 2022

  • set up tests
  • query conversions, remove all raw SQL.
  • cover most used scenarios in tests
  • minor code cleanup here and there.

don't backport

@ankush ankush force-pushed the refactor/stock_balance branch 4 times, most recently from 0f2bee1 to 919c4e0 Compare April 12, 2022 06:50
@ankush ankush marked this pull request as ready for review April 12, 2022 07:23
@ankush ankush added dont-merge dont squash Don't squash and merge labels Apr 12, 2022
@ankush ankush marked this pull request as draft April 12, 2022 12:15
@ankush
Copy link
Member Author

ankush commented Apr 12, 2022

Each warehouse having roughly 1000 unique item and 6000-10000 SLEs
Single warehouse:
Before: 50ns
After: 32ns

Group of 5 warehouse:
Before: 57ns
After: 35ns

A very marginal difference which is eliminated once # of child warehouses ~15-20 and will be somewhat slower on numbers higher than that. Not sure if this is worth it. The main difference will likely come from rewriting the whole qty and value logic in SQL.

@ankush ankush removed the dont-merge label Apr 12, 2022
@ankush ankush marked this pull request as ready for review April 14, 2022 08:54
@ankush ankush removed the request for review from rohitwaghchaure April 14, 2022 08:59
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #30677 (7448d7e) into develop (1659f1e) will decrease coverage by 0.04%.
The diff coverage is 96.96%.

❗ Current head 7448d7e differs from pull request most recent head 9af2d68. Consider uploading reports for the commit 9af2d68 to get more accurate results

@@             Coverage Diff             @@
##           develop   #30677      +/-   ##
===========================================
- Coverage    61.43%   61.39%   -0.05%     
===========================================
  Files         1080     1079       -1     
  Lines        69488    69265     -223     
===========================================
- Hits         42693    42523     -170     
+ Misses       26795    26742      -53     
Impacted Files Coverage Δ
...rpnext/stock/report/stock_balance/stock_balance.py 88.58% <96.96%> (+10.48%) ⬆️
...payroll/doctype/income_tax_slab/income_tax_slab.py 83.33% <0.00%> (-16.67%) ⬇️
erpnext/accounts/doctype/bank/bank.py 71.42% <0.00%> (-14.29%) ⬇️
...rial_no_valuation/incorrect_serial_no_valuation.py 85.96% <0.00%> (-10.53%) ⬇️
...t/accounts/report/sales_register/sales_register.py 70.76% <0.00%> (-7.02%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 81.48% <0.00%> (-5.77%) ⬇️
...ctype/woocommerce_settings/woocommerce_settings.py 80.76% <0.00%> (-3.85%) ⬇️
erpnext/hr/doctype/job_applicant/job_applicant.py 63.93% <0.00%> (-3.28%) ⬇️
erpnext/education/doctype/student/student.py 73.68% <0.00%> (-3.16%) ⬇️
...next/accounts/doctype/bank_account/bank_account.py 77.27% <0.00%> (-2.28%) ⬇️
... and 33 more

@ankush ankush removed the dont squash Don't squash and merge label Apr 14, 2022
@mergify mergify bot merged commit 41ec5ca into frappe:develop Apr 14, 2022
@ankush ankush deleted the refactor/stock_balance branch April 14, 2022 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants