Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Umělá inteligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    • Referral Program
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Handling Media in Odoo Helpdesk via External App

Odebírat

Get notified when there's activity on this post

This question has been flagged
tickethelpdeskmediaV16
2 Odpovědi
1451 Zobrazení
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
Zrušit
Hemanth
Autor

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
Autor

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
Nejlepší odpověď

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
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď
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
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
No Notification or Easy Way to Track Email Replies from Customers
ticket email helpdesk V16
Avatar
Avatar
1
bře 26
1833
How to add user email as follower when creating Odoo ticket
python ticket helpdesk V16
Avatar
Avatar
Avatar
2
pro 25
1414
Reply by email to helpdesk ticket problem Vyřešeno
ticket helpdesk
Avatar
Avatar
Avatar
3
bře 25
7663
How to get first help desk message from the customer in the create method?
ticket helpdesk
Avatar
0
kvě 21
6067
How to automatically sort tickets by last stage update?
helpdesk sort V16
Avatar
Avatar
1
úno 26
934
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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