Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Video Preview Widget in Odoo 12?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
widgetpreviewvideoodoo12Odoo13.0
3 Odpowiedzi
7361 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

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
Awatar
Odrzuć
IRFAN
Autor

Thanks for the response i will try this code

Awatar
Bhavin Patel
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
dunghn
Najlepsza odpowiedź

Please tell me how to do with version 16

0
Awatar
Odrzuć
dunghn

@Bhavin Patel how do you have video.converter service

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Use the video preview widget in odoo 16
widget preview video solved odoo16features
Awatar
Awatar
1
kwi 23
4925
How to learn odoo pos technical Rozwiązane
odoo12 Odoo13.0
Awatar
Awatar
1
lut 21
3679
How to widget="float_toggle" value will be unlimited?
widget Odoo13.0
Awatar
Awatar
1
gru 20
3982
odoo 13 widget dont run start function
widget Odoo13.0
Awatar
0
kwi 20
4484
Widget Conversion From Odoo 12 to Odoo 16
widget odoo12 odoo16features
Awatar
Awatar
Awatar
2
lip 23
4669
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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