-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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: item-warehouse based reposting #28124
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ankush
changed the title
refactor: item-warehouse based refactoring
refactor: item-warehouse based reposting
Oct 28, 2021
Codecov Report
@@ Coverage Diff @@
## develop #28124 +/- ##
===========================================
+ Coverage 55.29% 55.31% +0.01%
===========================================
Files 1119 1119
Lines 66636 66672 +36
===========================================
+ Hits 36848 36879 +31
- Misses 29788 29793 +5
|
ankush
force-pushed
the
item_wh_reposting
branch
3 times, most recently
from
November 2, 2021 10:43
d1eef5e
to
0f36460
Compare
ankush
requested review from
deepeshgarg007,
marination,
nextchamp-saqib and
rohitwaghchaure
as code owners
November 2, 2021 10:45
ankush
force-pushed
the
item_wh_reposting
branch
2 times, most recently
from
November 2, 2021 12:50
3a99511
to
cfdd895
Compare
ankush
added
backport version-13-hotfix
and removed
needs-tests
This PR needs automated unit-tests.
labels
Nov 2, 2021
Deduplication here can be moved to the background job and done while processing the queue. This has two benefits:
Edit: this change is done now. |
In current implementation selecting Item-Warehouse based reposting is better for few users, who don't use depenent SLEs but have frequent transactions involving same items. This change lets them switch to item-warehouse based reposting if required. Only use this if you understand technicalities of stock reposting. This is experimental but will become mainstream in coming days.
Item-WH based reposting requires querying existing similar repost. Assuming there is only 1 max extra entry with same params just indexing item-WH is sufficient to speed up the query.
kept for tracability.
Using basic idea that repost with older posting date will also take care of subsequent posting dates... When Item-WH reposts are queued: 1. If another repost with same item-wh but older posting date exists then skip current one. 2. If another repost with same item-wh but newer posting date exists then skip another one.
ankush
force-pushed
the
item_wh_reposting
branch
from
November 24, 2021 09:20
72233e8
to
60135ad
Compare
ankush
commented
Nov 24, 2021
ankush
added a commit
that referenced
this pull request
Nov 25, 2021
…-28124 refactor: item-warehouse based reposting (backport #28124)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivations:
Example backdated transactions:
Assuming all operating on the same set of items (or some shared items)
A causes reposting of A, B, C, D, E.
B causes reposting of B, C, D, E
C causes reposting of C, D and E, and so on... Ideally, the system should just figure out that reposting A is all that's required.
Changes:
WIP: Deferred to a separate PR
Should I enable this?
No, if you don't understand how Stock Reposting works in ERPNext then avoid using any of this. These changes will become the default in the coming months anyway.
'tsa zoke
How to test:
Testing deduplication: