You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: stock_movements_helper.rb
    path of file: ./repos/solidus/backend/app/helpers/spree/admin
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Spree
  module Admin
    module StockMovementsHelper
 
    
      def pretty_originator(stock_movement)
        originator = stock_movement.originator

        if originator.respond_to?(:number)
          if originator.respond_to?(:order)
            link_to originator.number, [:edit, :admin, originator.order]
          else
            originator.number
          end