OBPIH-6253 source pricing not visible when adding new product source on placed PO (manual and import)#4559
Merged
awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from Mar 22, 2024
Conversation
…ating a new product source on orderItem - check if product source has changed - removing lookup on product.packages becasue it casue a bug where it would unassing package from other product source because it is a 1:N relashinship where package can only have one product source
… importing orderItems
kchelstowski
approved these changes
Mar 22, 2024
alannadolny
approved these changes
Mar 22, 2024
awalkowiak
approved these changes
Mar 22, 2024
This file contains hidden or 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
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.
The issue that was discovered during QA was that productPackage would not be updated when creating a new product source through manual edit or import on PLACED Purchase Order.
Few things I modified are:
first I added an additional condition on edit
productSupplierChangedwhich just like other conditions checks if product Source of the orderItem is the same as the one provided by the package.Then secondly, after investigating the whole workflow I cam to the conclusion that the chunck of code
is causing a bug which caused the product Package to be unassigned from older product source.
I noticed that ProductPackage and ProductSource have a
1:Nrelationship where ProductPackage can only have one Product Source and a single Product source can have many product packages.When executing anove code
and later
we are finding an existing productPackage that is assigned to some other product Source and we are now assigning this package to new Product source which will unassign it from the previous one. I assume this is not an expected behavior.
Lastly, I noticed that when importing
orderitemswe are not updating productPackage like we do on the manual create/edit so I added this chunk of code which in my opinion was missing.