Skip to content

Shipment Processor only Imports a single InventoryUnit per LineItem #73

@cesartalves

Description

@cesartalves

This bug was first discovered by @aamyot

SolidusImporter::Processors::Shipment creates only one InventoryUnit per LineItem, when it should, in fact, create InventoryUnits equivalent to the LineItem amount.

Here's a suggestion:

def inventory_units
    sku = line_items_attributes[:sku]

    return [] if sku.blank?

    quantity = line_items_attributes[:quantity].to_i
    [{ sku: sku }] * quantity
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions