Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

[odoo v11] : How to embed video into form view?

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
embedodoo
2 Antworten
5613 Ansichten
Avatar
Anil Kesariya

Hello,

Is it possible to embed video in form view?

Rgds,

Anil


2
Avatar
Verwerfen
Avatar
Gracious Joseph
Beste Antwort

Yes, it's possible to embed a video into a form view in Odoo. You can achieve this by using the iframe HTML tag within the form view. Here's how you can embed a video, such as a YouTube or local video, into a form view in Odoo:

Steps to Embed a Video in a Form View

1. Add a Char or URL Field to Your Model

If you want the video URL to be dynamic (e.g., a YouTube video URL), add a field to your model to store the video link.

Example:

from odoo import models, fields

class YourModel(models.Model):
    _name = 'your.model'

    video_url = fields.Char(string="Video URL", help="Enter the video URL to embed")

2. Update the Form View XML

Modify the form view to include an iframe tag or video embed logic. Use the video_url field to load the video dynamically.

Example XML:

<record id="view_form_your_model" model="ir.ui.view">
    <field name="name">your.model.form</field>
    <field name="model">your.model</field>
    <field name="arch" type="xml">
        <form>
            <sheet>
                <group>
                    <field name="name"/>
                    <field name="video_url"/>
                </group>
                <group>
                    <div t-if="record.video_url.raw_value" style="margin-top: 20px;">
                        <iframe t-att-src="record.video_url.raw_value"
                                width="560"
                                height="315"
                                frameborder="0"
                                allowfullscreen>
                        </iframe>
                    </div>
                </group>
            </sheet>
        </form>
    </field>
</record>
  • Key Points:
    • t-if="record.video_url.raw_value" ensures the video is displayed only if a URL is provided.
    • t-att-src="record.video_url.raw_value" dynamically sets the src attribute of the iframe to the value of the video_url field.

3. Testing

  1. Navigate to the corresponding form view for your model in Odoo.
  2. Enter a video URL (e.g., a YouTube video: https://www.youtube.com/embed/VIDEO_ID).
  3. Save the record, and the video should appear embedded in the form view.

Alternative: Embed a Hardcoded Video

If you don’t need dynamic video URLs and want to embed a static video, you can directly include the iframe in the XML without using a field:

Example:

<group>
    <iframe src="https://www.youtube.com/embed/VIDEO_ID" 
            width="560" 
            height="315" 
            frameborder="0" 
            allowfullscreen>
    </iframe>
</group>

4. Security Considerations

  • Ensure the video URL comes from a trusted source to prevent embedding malicious content.
  • If users enter the video URL manually, validate it using Odoo's @api.constrains or custom validation logic in the model.

Example Validation:

from odoo.exceptions import ValidationError

@api.constrains('video_url')
def _check_video_url(self):
    for record in self:
        if record.video_url and not record.video_url.startswith("https://www.youtube.com/embed/"):
            raise ValidationError("Please provide a valid YouTube embed URL.")

5. Embedding a Local Video

If the video is hosted locally or within Odoo, you can use the file or binary field and render it using an HTML <video> tag.

Example:

  • Add a Binary field:
    video_file = fields.Binary(string="Video File")
    
  • Update the XML view:
    <group>
        <video t-if="record.video_file.raw_value" controls width="560" height="315">
            <source t-att-src="'data:video/mp4;base64,%s' % record.video_file.raw_value" type="video/mp4"/>
            Your browser does not support the video tag.
        </video>
    </group>
    

By following the steps above, you can easily embed videos into form views in Odoo for dynamic or static content. Let me know if you need further assistance!

0
Avatar
Verwerfen
Avatar
Mitul Shingala
Beste Antwort

hello,

see this link https://www.odoo.com/forum/help-1/question/how-to-display-video-in-the-website-121494

may this will be helps you.

0
Avatar
Verwerfen
Anil Kesariya
Autor

I appreciate Mitul, for the link you've shared. Unfortunately I'm not looking for that solution, that I know already, that how to embed in website page. My question is how to embed video on form view, which is comes in odoo back end web part. I hope now my question is clear to you. Anyway, thanks.

Kavine S

Were you able to make progress in this. I am using odoo 17 and still there is no way to embed a video in the backend webpart.

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
(!!C-o-p-a!!)¿Cómo comunicarse con Copa Airlines en Panamá?
odoo
Avatar
0
Nov. 25
201
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
Nov. 25
3317
(#iberia#)¿Cómo llamar a Iberia desde Panamá?
odoo
Avatar
0
Okt. 25
391
How to import product variants with my own external id when using dynamic creation mode Gelöst
odoo
Avatar
Avatar
2
Aug. 25
3866
How to import Bulk Image in Product your local database not any cloud, odoo.sh Gelöst
odoo
Avatar
Avatar
1
Juli 25
1897
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Ausbildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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