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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: SLE submission execution flow #28705

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

ankush
Copy link
Member

@ankush ankush commented Dec 3, 2021

Currently, this is how SLEs get submitted:

Document controller -> stock controller -> stock_ledger.py -> stock/utils.py -> bin.py -> stock_ledger.py 馃ゴ馃ゴ馃ゴ

update_bin in bin.py for some reason does a lot more than "UPDATE BIN"... inlined/replaced all the intermediate functions called after creating SLE.

Changes:

  • Bin.py now only has code that modifies Bin and nothing else.
  • make_sl_entries mostly executes inside a single file now instead of jumping across 3 files.

New simplified execution flow:
Document controller -> stock controller -> stock_ledger.py

TODO:

  • Replaces other lesser used references with new functions
  • deprecate old functions / re-route internally.

@ankush ankush marked this pull request as draft December 3, 2021 06:55
@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #28705 (3288b18) into develop (0b1808e) will decrease coverage by 0.01%.
The diff coverage is 72.00%.

@@             Coverage Diff             @@
##           develop   #28705      +/-   ##
===========================================
- Coverage    55.21%   55.19%   -0.02%     
===========================================
  Files         1121     1121              
  Lines        66785    66792       +7     
===========================================
- Hits         36872    36867       -5     
- Misses       29913    29925      +12     
Impacted Files Coverage 螖
erpnext/stock/doctype/bin/bin.py 87.27% <25.00%> (-4.54%) 猬囷笍
erpnext/stock/utils.py 65.27% <33.33%> (-2.10%) 猬囷笍
erpnext/stock/stock_ledger.py 85.46% <88.88%> (+0.16%) 猬嗭笍
...eport/item_variant_details/item_variant_details.py 31.32% <0.00%> (-53.02%) 猬囷笍
...xt/stock/report/stock_analytics/stock_analytics.py 91.08% <0.00%> (-2.98%) 猬囷笍
erpnext/stock/report/stock_ageing/stock_ageing.py 89.78% <0.00%> (-2.92%) 猬囷笍
.../report/stock_projected_qty/stock_projected_qty.py 86.84% <0.00%> (-2.64%) 猬囷笍
...eorder_level/itemwise_recommended_reorder_level.py 92.30% <0.00%> (-1.93%) 猬囷笍
erpnext/stock/report/stock_ledger/stock_ledger.py 76.42% <0.00%> (-1.63%) 猬囷笍
...ctype/accounting_dimension/accounting_dimension.py 64.06% <0.00%> (-1.57%) 猬囷笍
... and 20 more

@ankush ankush added backport version-13-hotfix Skip Manual Testing The changes in this PR does not require manual testing labels Dec 3, 2021
@ankush ankush marked this pull request as ready for review December 3, 2021 07:38
@ankush ankush force-pushed the refactor/sle_submission_flow branch from ee8a207 to 2b0b5d4 Compare December 3, 2021 07:38
@ankush ankush force-pushed the refactor/sle_submission_flow branch from 2b0b5d4 to 3288b18 Compare December 3, 2021 07:38
@ankush ankush merged commit cef84c2 into frappe:develop Dec 3, 2021
@ankush ankush deleted the refactor/sle_submission_flow branch December 3, 2021 09:21
@ankush ankush removed the Skip Manual Testing The changes in this PR does not require manual testing label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants