parameters: (self)
docstring: Verify the route of the product based on the warehouse
              set 'is_available' at True if the product availibility in stock does
              not need to be verified, which is the case in MTO, Cross-Dock or Drop-Shipping
docstring_summary: Verify the route of the product based on the warehouse
              set 'is_available' at True if the product availibility in stock does
              not need to be verified, which is the case in MTO, Cross-Dock or Drop-Shipping
docstring_tokens: Verify the route of the product based on the warehouse set is_available at True if the product availibility in stock does not need to be verified which is the case in MTO Cross - Dock or Drop - Shipping
function: def _compute_is_mto(self):
          """ Verify the route of the product based on the warehouse
              set 'is_available' at True if the product availibility in stock does
              not need to be verified, which is the case in MTO, Cross-Dock or Drop-Shipping
          """
          self.is_mto = False
          for line in self:
              if not line.display_qty_widget:
                  continue
              product = line.product_id
              product_routes = line.route_id or (product.route_ids + product.categ_id.total_route_ids)
  
              # Check MTO
              mto_route = line.order_id.warehouse_id.mto_pull_id.route_id
              if not mto_route:
                  try:
                      mto_route = self.env['stock.warehouse']._find_global_route('stock.route_warehouse0_mto', _('Make To Order'))
                  except UserError:
                      # if route MTO not found in ir_model_data, we treat the product as in MTS
                      pass
  
              if mto_route and mto_route in product_routes:
                  line.is_mto = True
              else:
                  line.is_mto = False
function_tokens: def _compute_is_mto ( self ) : self . is_mto = False for line in self : if not line . display_qty_widget : continue product = line . product_id product_routes = line . route_id or ( product . route_ids + product . categ_id . total_route_ids ) # Check MTO mto_route = line . order_id . warehouse_id . mto_pull_id . route_id if not mto_route : try : mto_route = self . env [ 'stock.warehouse' ] . _find_global_route ( 'stock.route_warehouse0_mto' , _ ( 'Make To Order' ) ) except UserError : # if route MTO not found in ir_model_data, we treat the product as in MTS pass if mto_route and mto_route in product_routes : line . is_mto = True else : line . is_mto = False