I'm working on an Odoo V16 Helpdesk setup where tickets are raised through an external app via FastAPI endpoint. If users upload images or screenshots with their tickets. I need to know how to handle these images in Odoo.
Can Odoo store and display these images directly, or is it better to use an external service like Amazon S3 for storage and how? If Odoo can handle the media, what’s the best way to integrate images from the external app?

Thank you Cybrosys for your answer. If we store images using the ir.attachment mechanism, will they be automatically displayed in the media in chat? Also, would it be fine to clear the media from the database after a certain period to keep it clean, or would that delete any built-in media as well? Are both types of media stored in the same place?
Good question. The beauty of the ir.attachment model is that "routing" the image and "tagging" it for safe deletion actually happen in the exact same step.
When your FastAPI sends the request to create the attachment, you are mandatory required to specify the target record. That specific field (res_model) is exactly what you will use later to filter your cleanup script.
1. How to ensure it routes to the Ticket: When your API calls the create method on ir.attachment, your payload must include these two fields:
'res_model': 'helpdesk.ticket' <-- This tells Odoo "This belongs to the Helpdesk app"
'res_id': 12345 <-- This is the specific Ticket ID you want to attach it to.
If you pass those, Odoo automatically links the file to that ticket. No extra routing logic is needed.
2. How to minimize delete risk: Since you must set 'res_model': 'helpdesk.ticket' to get the image on the ticket in the first place, you have effectively "tagged" it.
Your cleanup Cron job becomes very safe because you can simply tell it: "Find all attachments created more than 6 months ago WHERE res_model == 'helpdesk.ticket'."
As long as your script strictly filters by that model name, it is impossible for it to accidentally delete a system asset or product image, because those will have different model names (like product.template).
Hope that helps you build the endpoint!
I understand CandidRoot thanks :) but suppose we take the image directly from the user using FastAPI and store it in ir.attachment. How can we ensure that it is routed to the linked ticket and that the model is set to helpdesk.ticket, minimizing the risk to periodically delete?