Prechádzať zdrojové kódy

fix(core): Fix FastImporterService when using stockOnHand

A recent PR (#3288) added support for the newer `stockLevels` API, but
failed to include a backward-compatible fallback.
Michael Bromley 10 mesiacov pred
rodič
commit
f97484c928

+ 1 - 1
packages/core/src/data-import/providers/importer/fast-importer.service.ts

@@ -192,7 +192,7 @@ export class FastImporterService {
         await this.stockMovementService.adjustProductVariantStock(
             this.importCtx,
             createdVariant.id,
-            input.stockLevels ?? 0,
+            input.stockLevels ?? input.stockOnHand ?? 0,
         );
         const assignedChannelIds = unique([this.defaultChannel, this.importCtx.channel], 'id').map(c => c.id);
         for (const channelId of assignedChannelIds) {