Fetch product images from Odoo using session-based authentication.
pip install odoo-image-fetcher
from odoo_image_fetcher import ImageFetcher
image_bytes = ImageFetcher.fetch_image("/web/image/product.template/17956/image_128")
if image_bytes:
with open("product_image.png", "wb") as f:
f.write(image_bytes)
print("✅ Image saved.")
else:
print("❌ Image fetch failed.")
Put these in a .env
file or your environment:
ODOO_BASE_URL=https://your.odoo.instance
ODOO_USERNAME=your@email.com
ODOO_PASSWORD=yourpassword
ODOO_DB=your_db_name