code: protected function detachSaleItemRecursively(SaleItemInterface $item)
      {
          $this->stockAssigner->detachSaleItem($item);
  
          foreach ($item->getChildren() as $child) {
              $this->detachSaleItemRecursively($child);
          }
      }
docs: Detaches the sale item from stock units recursively.
  
  @param SaleItemInterface $item