-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix issue 3164 - generate shipments for backend-added products when necessary #3197
Fix issue 3164 - generate shipments for backend-added products when necessary #3197
Conversation
4e8dbaa
to
50c78cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @spaghetticode, great work. I just left some comments about things that maybe can be improved or questions, let me know your thoughts!
50c78cd
to
97a4c95
Compare
111caef
to
eb4bd35
Compare
d606968
to
135510f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks, @spaghetticode!
d606968
to
98cedb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as usual @spaghetticode!
The new method builds missing inventory units for the specified line item. inventory_unit_builder
Sometimes necessity arises to create shipments for an order that is already completed, for example when adding an item in the backend using the `Cart` tab. The existing method `#create_proposed_shipments` cannot be used, as the order is completed, so this new method creates only the missing shipments for the newly added line item.
…t_shipment As sometimes availability matters, it's better to choose an existing shipment that leaves from a stock location that has enough availability for the chosen variant, facilitating warehouse management.
When OrderInventory#determine_target_shipment cannot find a suitable shipment that can accommodate the added variant, then it's necessary to create at least one new shipment for that purpose. This is done by leveraging Order#create_shipments_for_line_item, which creates missing shipments for the newly added items.
98cedb1
to
3847475
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
solidusio/solidus#3197 add a mandatory parameter which we should send
Description
This PR fixes issue #3164. See the issue for further details.
An error occurs when trying to add a product to an existing completed order in the backend and the product stock is not compatible with existing shipments.
This PR adds the ability, when necessary, to generate new shipments also when the order is completed.
Checklist: