Cómo solucionar InvenTree remote_image: Downloading images from remote URL is not enabled

Problema:

Al intentar crear un objeto InvenTree usando un URL remote_image, ves un mensaje de error como

inventree_remote_image_error.txt
requests.exceptions.HTTPError: {'detail': 'Error occurred during API request', 'url': 'https://inventree-test.mydomain.com/api/company/', 'method': 'POST', 'status_code': 400, 'body': '{"remote_image":["Downloading images from remote URL is not enabled"]}', 'headers': {'AUTHORIZATION': 'Token 6daae3817756e9c1a3603b14d9582e61f50db388'}, 'params': {'format': 'json'}, 'data': {'name': 'DigiKey', 'website': 'https://www.digikey.de/', 'remote_image': 'https://logodix.com/logo/1667872.jpg', 'description': '', 'is_manufacturer': False, 'is_supplier': True, 'is_customer': False, 'currency': 'EUR'}}

Solución

Abre la interfaz web de InvenTree, abre Server Configuration a la izquierda

InvenTree web interface showing Server Configuration menu entry on the left sidebar

y habilita Download from URL.

InvenTree server configuration settings with Download from URL option enabled

El ajuste será efectivo inmediatamente. No hay necesidad de hacer clic en ningún botón Apply ni reiniciar el servidor.


Echa un vistazo a artículos similares por categoría: Allgemein