from oscar.core.loading import get_model

ShippingEventType = get_model('order', 'ShippingEventType')
Order = get_model('order', 'Order')

def create_in_transit_event(order_num, event_group, lines=None):

        order = Order.objects.get(number=order_num)

        # Event marked as "in transit", payment should be made
        in_transit_event = order.shipping_events.create(
            event_type=ShippingEventType.objects.get(code="in_transit"), group=event_group)
        if lines:
            for line in lines.all():
                in_transit_event.line_quantities.create(line=line, quantity=line.quantity)
        else:
            # No specified lines, use all lines from the order
            for line in order.lines.all():
                in_transit_event.line_quantities.create(line=line, quantity=line.quantity)
95529c9cb692f979e1aa67c465d4ba68fe9e9fd5
<mask token>

<mask token>


def create_in_transit_event(order_num, event_group, lines=None):
    order = Order.objects.get(number=order_num)
    in_transit_event = order.shipping_events.create(event_type=
        ShippingEventType.objects.get(code='in_transit'), group=event_group)
    if lines:
        for line in lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)
    else:
        for line in order.lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)

<mask token>
ShippingEventType = get_model('order', 'ShippingEventType')
Order = get_model('order', 'Order')


def create_in_transit_event(order_num, event_group, lines=None):
    order = Order.objects.get(number=order_num)
    in_transit_event = order.shipping_events.create(event_type=
        ShippingEventType.objects.get(code='in_transit'), group=event_group)
    if lines:
        for line in lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)
    else:
        for line in order.lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)

from oscar.core.loading import get_model
ShippingEventType = get_model('order', 'ShippingEventType')
Order = get_model('order', 'Order')


def create_in_transit_event(order_num, event_group, lines=None):
    order = Order.objects.get(number=order_num)
    in_transit_event = order.shipping_events.create(event_type=
        ShippingEventType.objects.get(code='in_transit'), group=event_group)
    if lines:
        for line in lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)
    else:
        for line in order.lines.all():
            in_transit_event.line_quantities.create(line=line, quantity=
                line.quantity)

from oscar.core.loading import get_model

ShippingEventType = get_model('order', 'ShippingEventType')
Order = get_model('order', 'Order')

def create_in_transit_event(order_num, event_group, lines=None):

        order = Order.objects.get(number=order_num)

        # Event marked as "in transit", payment should be made
        in_transit_event = order.shipping_events.create(
            event_type=ShippingEventType.objects.get(code="in_transit"), group=event_group)
        if lines:
            for line in lines.all():
                in_transit_event.line_quantities.create(line=line, quantity=line.quantity)
        else:
            # No specified lines, use all lines from the order
            for line in order.lines.all():
                in_transit_event.line_quantities.create(line=line, quantity=line.quantity)