Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Handling Media in Odoo Helpdesk via External App

Subscribe

Get notified when there's activity on this post

This question has been flagged
tickethelpdeskmediaV16
2 Replies
1405 Views
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
Discard
Hemanth
Author

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
Author

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
Best Answer

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
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
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
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
No Notification or Easy Way to Track Email Replies from Customers
ticket email helpdesk V16
Avatar
Avatar
1
Mar 26
1782
How to add user email as follower when creating Odoo ticket
python ticket helpdesk V16
Avatar
Avatar
Avatar
2
Dec 25
1391
Reply by email to helpdesk ticket problem Solved
ticket helpdesk
Avatar
Avatar
Avatar
3
Mar 25
7555
How to get first help desk message from the customer in the create method?
ticket helpdesk
Avatar
0
May 21
5917
How to automatically sort tickets by last stage update?
helpdesk sort V16
Avatar
Avatar
1
Feb 26
911
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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