'Create or update the cross dock operations route, that can be set on
products and product categories'

def _create_or_update_crossdock_route(self, routes_data):

    routes_data = (routes_data or self.get_routes_dict())
    for warehouse in self:
        if warehouse.crossdock_route_id:
            crossdock_route = warehouse.crossdock_route_id
            crossdock_route.write({'active': ((warehouse.reception_steps != 'one_step') and (warehouse.delivery_steps != 'ship_only'))})
        else:
            crossdock_route = self.env['stock.location.route'].create(warehouse._get_crossdock_route_values())
            routings = routes_data[warehouse.id]['crossdock']
            (dummy, pull_rules_list) = warehouse._get_push_pull_rules_values(routings, values={'active': ((warehouse.delivery_steps != 'ship_only') and (warehouse.reception_steps != 'one_step')), 'route_id': crossdock_route.id}, push_values=None, pull_values={'procure_method': 'make_to_order'})
            for pull_vals in pull_rules_list:
                self.env['procurement.rule'].create(pull_vals)
    return crossdock_route
