fix(core-flows): skip location check if inventory is not managed (#12540)
* fix: skip location check if inventory is not managed * fix: rm todo * chore: changeset
This commit is contained in:
5
.changeset/tough-bats-walk.md
Normal file
5
.changeset/tough-bats-walk.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/core-flows": patch
|
||||
---
|
||||
|
||||
fix(core-flows): skip location check if variant is not managed when preparing inventory confirm
|
||||
@@ -92,25 +92,7 @@ describe("prepareConfirmInventoryInput", () => {
|
||||
{
|
||||
id: "pv_2",
|
||||
manage_inventory: false,
|
||||
inventory_items: [
|
||||
{
|
||||
inventory_item_id: "ii_2",
|
||||
variant_id: "pv_2",
|
||||
required_quantity: 1,
|
||||
inventory: [
|
||||
{
|
||||
location_levels: {
|
||||
stock_locations: [
|
||||
{
|
||||
id: "sl_1",
|
||||
sales_channels: [{ id: "sc_1" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
inventory_items: [], // not managed variant doesn't have inventory
|
||||
},
|
||||
],
|
||||
items: [
|
||||
|
||||
@@ -151,6 +151,7 @@ export const prepareConfirmInventoryInput = (data: {
|
||||
if (salesChannelId) {
|
||||
for (const variant of allVariants.values()) {
|
||||
if (
|
||||
variant.manage_inventory &&
|
||||
!variantsWithLocationForChannel.has(variant.id) &&
|
||||
!variant.allow_backorder
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user