Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Handling Media in Odoo Helpdesk via External App

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
tickethelpdeskmediaV16
2 Réponses
1442 Vues
Avatar
Hemanth

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?

0
Avatar
Ignorer
Hemanth
Auteur

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?

CandidRoot Solutions

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!

Hemanth
Auteur

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?

Avatar
CandidRoot Solutions
Meilleure réponse

Hi Hemanth,

To answer your follow-up questions regarding the ir.attachment route:

1. Will they show in the Chatter? Yes and no.

  • If you just create the ir.attachment record linked to the ticket, the file will appear in the "Attachments" menu (the paperclip icon) at the top of the chatter.

  • If you want the image to actually appear inside the chat stream (like a WhatsApp message), your FastAPI endpoint should call the message_post method on the ticket and pass the attachment_ids. This effectively "sends" the image as a message so the support agent sees it immediately in the thread.

2. Can we auto-delete old media? (The Risk) You can write a Scheduled Action (Cron) to delete old attachments to save space, but you have to be extremely careful.

  • Are they stored in the same place? Yes. Your company logo, website assets, and these ticket images all live in the same ir.attachment table (and likely the same /filestore folder on the server).

  • The Danger: If you just run a script to "delete all attachments older than 6 months," you will break your website images, product photos, and company branding.

The Solution: If you set up a cleanup script, make sure you filter strictly by model. Only delete attachments where res_model = 'helpdesk.ticket'. Do not touch attachments where res_model is ir.ui.view or product.template.

So in summary: Go with the native Odoo attachment method, but if you automate cleanup, make sure your script checks the "Model" field so you don't wipe out your system icons!

Hope that clarifies things!

If this helped, kindly upvote.
Best Regards,


CandidRoot Solutions Pvt. Ltd.
Mobile: (+91) 8849036209
Whatapp: (+91) 8849036209

Email: info@candidroot.com
Web: https://www.candidroot.com

2
Avatar
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse
Hi,

Odoo V16 can effectively store and display images directly for Helpdesk tickets using its ir.attachment mechanism, where files are linked to records and stored either in the database or on the filesystem. This approach offers simpler integration, a seamless user experience within Odoo's interface, and leverages Odoo's built-in security and backup features. To integrate images from an external FastAPI application, you would typically encode the image data to base64 and then use Odoo's API (XML-RPC or JSON-RPC) to create an ir.attachment record, linking it to the relevant Helpdesk ticket. The main consideration for this method is the potential growth of your Odoo database or filestore with a very high volume of large images.

Alternatively, you could use an external service like Amazon S3 for image storage. In this scenario, your FastAPI application would upload images directly to S3, and Odoo would only store the S3 URL in a custom field on the Helpdesk ticket. This method offers superior scalability, performance, and keeps your Odoo database lean, but it introduces more complexity. Displaying these S3-hosted images natively within Odoo would require custom development, such as creating a custom widget to render the S3 URL as an image tag, and managing S3 access and security separately.

For most standard Odoo Helpdesk setups, storing images directly within Odoo as ir.attachment records is the recommended and more straightforward solution due to its native integration and ease of use. Amazon S3 should primarily be considered for scenarios involving extremely high volumes of large images, specific compliance requirements, or if you already have a robust S3 infrastructure in place.

Hope it helps

-2
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
No Notification or Easy Way to Track Email Replies from Customers
ticket email helpdesk V16
Avatar
Avatar
1
mars 26
1828
How to add user email as follower when creating Odoo ticket
python ticket helpdesk V16
Avatar
Avatar
Avatar
2
déc. 25
1406
Reply by email to helpdesk ticket problem Résolu
ticket helpdesk
Avatar
Avatar
Avatar
3
mars 25
7650
How to get first help desk message from the customer in the create method?
ticket helpdesk
Avatar
0
mai 21
6055
How to automatically sort tickets by last stage update?
helpdesk sort V16
Avatar
Avatar
1
févr. 26
928
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now