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:
1 parent
db33616cf9
commit
3071d09a03
3 files changed
+7
-19
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/core-flows": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(core-flows): skip location check if variant is not managed when preparing inventory confirm
|
||||||
+1
-19
@@ -92,25 +92,7 @@ describe("prepareConfirmInventoryInput", () => {
|
|||||||
{
|
{
|
||||||
id: "pv_2",
|
id: "pv_2",
|
||||||
manage_inventory: false,
|
manage_inventory: false,
|
||||||
inventory_items: [
|
inventory_items: [], // not managed variant doesn't have inventory
|
||||||
{
|
|
||||||
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" }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
items: [
|
items: [
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ export const prepareConfirmInventoryInput = (data: {
|
|||||||
if (salesChannelId) {
|
if (salesChannelId) {
|
||||||
for (const variant of allVariants.values()) {
|
for (const variant of allVariants.values()) {
|
||||||
if (
|
if (
|
||||||
|
variant.manage_inventory &&
|
||||||
!variantsWithLocationForChannel.has(variant.id) &&
|
!variantsWithLocationForChannel.has(variant.id) &&
|
||||||
!variant.allow_backorder
|
!variant.allow_backorder
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in new issue
Block a user