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

How to get images from db on QWeb report - Odoo 8

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
imageqwebreportodoo-8
8 Odpowiedzi
23856 Widoki
Awatar
Alejandro Perez Cosio

Hello all,

I found the way to save an image at my DB using fields.Binary().
Now, I need to get that image on my QWeb report.. 
Do you know how to call that field from the Qweb report?

Thanks in advance!

Regards
Alejandro

0
Awatar
Odrzuć
Pascal Tremblay

+1 for this post. I will follow it.

Alejandro Perez Cosio
Autor

A real use-case could be "how to print the field product_template.image on a QWeb report" since that field is a binary type.

Luke Branch

@Alejandro, are you storing the image in a one2many relationship (eg. order lines), or is this just a single field that you would like to include on a report? Please let me know what report you are working on and how you would like to display the field (eg. a t-foreach t-as type loop - eg. order lines). I've already built a theme module that includes heavy modification of the default quotation, sales order, invoice, etc. reports. I'll be separating this into a standalone module here: https://github.com/OdooCommunityWidgets/product_extended_report_order_lines over the next few days if that is any help.

Alejandro Perez Cosio
Autor

Hello @Luke, I'm working with a single binary field 'product_template.image'. I would like to include that image on a QWeb report. Thank you for your interest!

Awatar
Alejandro Perez Cosio
Autor Najlepsza odpowiedź

@Luke, I found a response from you for a similar question (\source)

Now I'm printing the image in the QWeb report this way:

<span t-field="product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>

Thank you!

2
Awatar
Odrzuć
Luke Branch

@Alejandro, no problem, i'm glad it helped.

Awatar
Kirubanidhi Rajarathinam
Najlepsza odpowiedź

Hello Alejandro Perez Cosio,

     In  my code is working fine, 
Staff_id is a many2one fields. Staff_image field is having staff table. Im accessing a field from staff table image field into my student table.
doc.staff_id.staff_image


<div class="col-xs-4 col-xs-offset-3">

            <strong text-align="right">Staff Image</strong>

            <span t-field="doc.staff_id.staff_image"

t-field-options='{"widget": "image","class": "oe_avatar"}' />

</div>

0
Awatar
Odrzuć
Awatar
Pascal Tremblay
Najlepsza odpowiedź

Look at this...

in report_purchasequotation_document, I can get image with code :

            <h2>Request for quotation : N° <span t-field="o.name"/></h2>
            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th class="text-left"><strong>   Picture</strong></th>
                        <th class="text-left"><strong>Description</strong></th>
                        <th class="text-center"><strong>Expected date</strong></th>
                        <th class="text-right"><strong>Quantity</strong></th>
                    </tr>
                </thead>
                <tbody>
                    <tr t-foreach="o.order_line" t-as="order_line">
                        <td>
                             <span t-field="order_line.product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>
                        </td>
                        <td>
                             <span t-field="order_line.name"/>
                        </td>
                        <td class="text-center">
                                <p t-field="order_line.date_planned" t-field-options='{"format": "d MMMM y"}'/>
                        </td>
                        <td class="text-right">
                            <span t-field="order_line.product_qty"/>
                            <span t-field="order_line.product_uom" groups="product.group_uom"/>
                        </td>
                    </tr>
                </tbody>
            </table>

 

In report_saleorder_document, I can NOT get image with code :

            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th> Picture</th>
                        <th>Description</th>
                        <th>Taxes</th>
                        <th class="text-right">Quantity</th>
                        <th class="text-right">Unit price</th>
                        <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
                        <th class="text-right">Price</th>
                    </tr>
               </thead>
               <tbody class="sale_tbody">
                    <tr t-foreach="o.order_line" t-as="l">
                        <td>
                           <span t-field="l.product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>
                        </td>
                        <td><span t-field="l.name"/>
                       </td>
                        <td>
                            <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.product_uom_qty"/>
                            <span groups="product.group_uom" t-field="l.product_uom"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.price_unit"/>
                        </td>
                        <td groups="sale.group_discount_per_so_line">
                            <span t-field="l.discount"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.price_subtotal" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.pricelist_id.currency_id&quot;}"/>
                        </td>
                    </tr>
                </tbody>
            </table>

 

Do you see the problem guy?

0
Awatar
Odrzuć
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ść
Add image field for report header Rozwiązane
image qweb report
Awatar
Awatar
1
maj 15
14794
odoo 16 report target new page scss
qweb report
Awatar
Awatar
1
kwi 25
2177
Missing external identifier on new external layout template Rozwiązane
qweb report
Awatar
Awatar
2
mar 25
2769
Translate month name in t-esc Qweb report Rozwiązane
qweb report
Awatar
Awatar
Awatar
Awatar
Awatar
4
lis 24
8127
QWeb Report Shows Different When Edit And Print Review Rozwiązane
qweb report
Awatar
Awatar
1
mar 24
2944
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