forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Finalize shipment after inventory units are added to completed order #10
Merged
vassalloandrea
merged 52 commits into
nebulab:master
from
DanielePalombo:nebulab/finalize-inventory-units
Dec 12, 2018
Merged
Finalize shipment after inventory units are added to completed order #10
vassalloandrea
merged 52 commits into
nebulab:master
from
DanielePalombo:nebulab/finalize-inventory-units
Dec 12, 2018
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
6c73dcb
to
21855d1
Compare
47e7621
to
0046c51
Compare
0046c51
to
ba65a2d
Compare
d8dec98
to
64bb34a
Compare
51cc0e9
to
eb3488e
Compare
eb3488e
to
187a260
Compare
187a260
to
c9367a8
Compare
It is important that the documentation shows a proper example of namespacing promotion actions.
I have come across a use case in which the product's sku attribute needs to be editable by the admin even in the event that the product has variants. This commit adds a user interface element for a Master SKU which updates the Spree::Product's sku attribute. It is visible regardless of the number of variants, which satisfies my use case.
The old name wasn't that explicit about what it is testing
Let users explicitly create a new code on an existing promotion, without checking if it's a "single" or "multiple" promotion type because it's already possible do switch from a "single" to "multiple" using the `Spree::PromotionCodeBatch` creation process. This let the user creates a new code without using the "batch" method so that it can explicitly choose a new code without using random suffixes.
`.full_messages.to_sentence` will do the same as `.full_messages.join(', ')` but uses an "and" as last divider
This applies only to some deprecated blocks and does not change the new, working logic. This means that if those methods were used by some store or extension, they will now don't have the creator set instead of having a specific user that could even be not present in the database, causing the creator to be nil anyway.
Otherwise people coming from the website will be confused about where the doc sources are hosted. The link now points to the README inside guides/, to which this commit adds an introductory paragraph with further guidance.
Using `prepend self` avoids repetition and potential errors coming from copy/paste. Reducing the module nesting makes it less prone to mis-referencing constants by skipping the namespace, requiring a the qualified reference to be used instead.
…address-dependency Remove default address dependency part 2
…s-docs improve decorators / contributing docs
remove unused routes and actions from return authorizations
Remove duplicated CHANGELOG
Remove broken links, add Yarn and remove Gulp, which does not seem to be used
This is needed for a security issue: CVE-2017-16028 Vulnerable versions: < 3.0.0 Patched version: 3.0.0 https://nvd.nist.gov/vuln/detail/CVE-2017-16028
In latest Twitter Bootstrap versions form-control height is no more auto and this change is needed to make our search bar work properly, see: twbs/bootstrap#26820
…tegory_index_exception symbol can't be argument for :count in east slavic locales
…omotion-actions Update promotion actions documentation
Guides improvements
Create a new promotion code inside an existing promotion
…ze-field-label Add missing yml for label
…er-over-search Use filter over search for filter options
…product-sku Add a Master SKU field to the products form
…ent-typo Fix a typo
Spree::Stock::InventoryUnitsFinalizer is responsible to: - Unstock the desired quantity - Update the inventory units to not pending The finalize logic inside the `run!` method has been taken from https://github.com/solidusio/solidus/blob/64bb34aa5837bca0580002d608358b0826d94ae6/core/app/models/spree/shipment.rb#L167-L172
While inventory units are being add to the shipment, collect and finalize them if the order is completed.
Added `finalize_pending_inventory_units` method that is responsible to finalize just pending inventory units.
c9367a8
to
98cbf42
Compare
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.
This PR is going to fix the issue solidusio#2141 .
Create a new class Spree::Stock::InventoryUnitsFinalizer
to finalize the inventory units provided.
It unstocks the desired quantity and marks as not pending the inventory units processed.
To fix the issue we run it, both when a shipment is finalized and when a variant is added to a shipment in a completed order.