fix(core-flows): select stock locations for reservation from correct SC (#10661)
* fix: add stock location for reservations only if related to correct SC * fix: update spec * fix: wrong SC id get in OE flow * fix: ensure test case has multiple SC and SLs
This commit is contained in:
@@ -67,7 +67,7 @@ export const prepareConfirmInventoryInput = (data: {
|
||||
hasSalesChannelStockLocation = true
|
||||
}
|
||||
|
||||
if (stock_locations) {
|
||||
if (stock_locations && sales_channels?.id === salesChannelId) {
|
||||
stockLocationIds.add(stock_locations.id)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import {
|
||||
Modules,
|
||||
OrderStatus,
|
||||
OrderWorkflowEvents
|
||||
OrderWorkflowEvents,
|
||||
} from "@medusajs/framework/utils"
|
||||
import {
|
||||
createWorkflow,
|
||||
|
||||
@@ -215,7 +215,7 @@ export const confirmOrderEditRequestWorkflow = createWorkflow(
|
||||
const formatedInventoryItems = transform(
|
||||
{
|
||||
input: {
|
||||
sales_channel_id: (orderItems as any).order.sales_channel_id,
|
||||
sales_channel_id: (orderItems as any).sales_channel_id,
|
||||
variants,
|
||||
items,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user