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: payatron_4000.rb
    path of file: ./repos/trado/lib
    
    the code of the file until where you have to start completion: module Payatron4000

    class << self

        # Creates a new stock level record for each order_item SKU, adding the o
    
        def update_stock order
            order.order_items.each do |item|
                sku = Sku.find(item.sku_id)
                description = item.order_item_accessory.nil? ? "Order ##{order.id}" : "Order ##{order.id} (+ #{item.order_item_accessory.accessory.name})"
                stock_adjustment = StockAdjustment.new(description: description, adjustment: -item.quantity, sku_id: item.sku_id)
                stock_adjustment.save!
            end
        end