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:
Frane Polić
2025-05-21 15:37:43 +02:00
committed by GitHub
parent db33616cf9
commit 3071d09a03
3 changed files with 7 additions and 19 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/core-flows": patch
---
fix(core-flows): skip location check if variant is not managed when preparing inventory confirm

View File

@@ -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: [

View File

@@ -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
) {