Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Video Preview Widget in Odoo 12?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
widgetpreviewvideoodoo12Odoo13.0
3 Replies
7366 Tampilan
Avatar
IRFAN

Hi,

In Odoo13 we have video preview widget(video_preview)​​ to preview the video.But this is not available in Odoo12, is there any other way to preview the video like in Odoo12(with or without widget).

Thanks

1
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi Irfan,

By using following code you can create a new video preview widget in Odoo 12.

In .js file

odoo.define('website_sale.video_field_preview', function (require) {
"use strict";

var AbstractField = require('web.AbstractField');
var core = require('web.core');
var fieldRegistry = require('web.field_registry');

var QWeb = core.qweb;
/**
* Displays preview of the video showcasing product.
*/
var FieldVideoPreview = AbstractField.extend({
className: 'd-block o_field_video_preview',

_render: function () {
this.$el.html(QWeb.render('productVideo', {
embedCode: this.value,
}));
},
});

fieldRegistry.add('video_preview', FieldVideoPreview);

return FieldVideoPreview;

});

In .xml file

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="productVideo">
        <div class="embed-responsive embed-responsive-16by9 " t-if="embedCode">
            <t t-raw="embedCode"/>
        </div>
    </t>
</templates>

After placing this code you can use the widget video_preview.

Hope it helps

2
Avatar
Buang
IRFAN
Penulis

Thanks for the response i will try this code

Avatar
Bhavin Patel
Jawaban Terbai

Hi Dunghn

In Odoo 16, you can use the video_preview widget in your custom module to display a preview of a video file. Here is an example of how you can use it:

from odoo import models, fields

class MyModel(models.Model):
_name = 'my.model'

video_file = fields.Binary(string='Video File')
video_preview = fields.Binary(string='Video Preview', compute='_compute_video_preview', store=True)

def _compute_video_preview(self):
for record in self:
if record.video_file:
video_preview = self.env['ir.attachment'].search([('res_model', '=', 'my.model'), ('res_id', '=', record.id), ('name', 'ilike', 'video_preview')], limit=1)
if not video_preview:
video_preview = self.env['ir.attachment'].create({
'name': 'video_preview',
'datas': self.env['video.converter'].convert(record.video_file),
'res_model': 'my.model',
'res_id': record.id,
})
record.video_preview = video_preview.datas if video_preview else False

In this example, we have a model called MyModel which has a video_file field that stores the video file as binary data, and a video_preview field that will display the video preview.

The _compute_video_preview method is used to convert the video file to a preview and store it in the video_preview field. It first searches for an existing video preview attachment for the current record, and if one is not found, it uses the video.converter service to convert the video file to a preview and creates a new attachment for the preview.

To display the video preview in the form view, you can use the widget attribute in the field definition:

xml
field name="video_preview" widget="video_preview" readonly="1"/



This will display the video preview in the form view when the record is opened. Note that the readonly attribute is set to 1 to prevent the user from editing the preview.



0
Avatar
Buang
Avatar
dunghn
Jawaban Terbai

Please tell me how to do with version 16

0
Avatar
Buang
dunghn

@Bhavin Patel how do you have video.converter service

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Use the video preview widget in odoo 16
widget preview video solved odoo16features
Avatar
Avatar
1
Apr 23
4926
How to learn odoo pos technical Diselesaikan
odoo12 Odoo13.0
Avatar
Avatar
1
Feb 21
3680
How to widget="float_toggle" value will be unlimited?
widget Odoo13.0
Avatar
Avatar
1
Des 20
3983
odoo 13 widget dont run start function
widget Odoo13.0
Avatar
0
Apr 20
4484
Widget Conversion From Odoo 12 to Odoo 16
widget odoo12 odoo16features
Avatar
Avatar
Avatar
2
Jul 23
4670
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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