Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

[Odoo12.0] How to display image in kanban view?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
imageviewvalueskanbanraw
9 Răspunsuri
31124 Vizualizări
Imagine profil
Jignesh Mehta

Hello,

I have 1 custom class and there are fields in it. When I create kanban view for that, I am facing below error.

test.py :-

class Test(models.Model):
    _name = 'test.test'
    _description = 'Test'

    name = fields.Char('Name')
    product_id = fields.Many2one('product.product', 'Product')
    image_medium = fields.Binary('Image', related='product_id.image_medium')

test_view.xml :-

<odoo>
    <record id="test_kanban_view" model="ir.ui.view">
        <field name="name">test.test.kanban.view</field>
        <field name="model">test.test</field>
        <field name="arch" type="xml">
            <kanban>
                <field name="name"/>
                <field name="image_medium"/>
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="oe_kanban_global_click">
                            <div class="oe_kanban_details">
                                <div class="row">
                                    <div class="col-md-3">
                                        <div class="o_kanban_image">
                                            <img t-att-src="kanban_image('test.test','image_medium',record.id.raw_value)" alt="Image"/>
                                        </div>
                                    </div>
                                    <div class="col-md-5">
                                        <strong><field name="name"/></strong>
                                        <div name="tags"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>
</odoo>

Error :-

Uncaught TypeError: Cannot read property 'raw_value' of undefined
http://0.0.0.0:9898/web?debug#action=371&model=work.order&view_type=list&menu_id=241:16
Traceback:
TypeError: Cannot read property 'raw_value' of undefined
    at Engine.eval (eval at _render (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3416:73), <anonymous>:16:120)
    at Engine._render (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3415:296)
    at Engine.render (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3415:151)
    at Engine._render (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3419:57)
    at Engine.render (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3415:151)
    at Class._render (http://0.0.0.0:9898/web/content/373-51b7014/web.assets_backend.js:1780:132)
    at Class.start (http://0.0.0.0:9898/web/content/373-51b7014/web.assets_backend.js:1770:1256)
    at Class.prototype.(anonymous function) [as start] (http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3537:488)
    at http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:3682:52
    at http://0.0.0.0:9898/web/content/341-db51ea1/web.assets_common.js:802:681


How can I solve this error ?
Any answer will be appreciable.

Thanks,

2
Imagine profil
Abandonează
Imagine profil
Ramla
Cel mai bun răspuns

<odoo>

<record id="test_kanban_view" model="ir.ui.view">

<field name="name">test.test.kanban.view</field>

<field name="model">test.test</field>

<field name="arch" type="xml">

<kanban>

<field name="id"/>

<field name="name"/>

<field name="image_medium"/>

<templates>

<t t-name="kanban-box">

<div t-attf-class="oe_kanban_global_click">

<div class="oe_kanban_details">

<div class="row">

<div class="col-md-3">

<div class="o_kanban_image">

<img t-att-src="kanban_image('test.test','image_medium',record.id.raw_value)"/>

</div>

</div>

<div class="col-md-5">

<strong><field name="name"/></strong>

<div name="tags"/>

</div>

</div>

</div>

</div>

</t>

</templates>

</kanban>

</field>

</record>

</odoo>

2
Imagine profil
Abandonează
Jignesh Mehta
Autor

Thank you so much for your answer. In odoo12, we have to define <field name="id"/> which is not compulsory in odoo10.

Ramla

You are welcome

vrushparva vaishnav

I had the same problem. solved by define id field in before <template/>

Imagine profil
Francisco Alvarez Ortiz
Cel mai bun răspuns

hello, you need to place the product_id field before <template>

I have the same problem:

See how i solved it:

<kanban>

 <field name="name"/>

 <field name="estate_id"/> 

 <templates> <t t-name="kanban-box"> <div class="oe_kanban_global_click"> <div class="o_kanban_image"> 

 <img t-att-src="kanban_image('estates.estate', 'image', record.estate_id.raw_value)" /> 

 <div class="o_kanban_card_content"> <div class="oe_kanban_details">
<div><strong><field name="email"/></strong></div>

 <div><field name="street"/></div> 

 <div><field name="mobile"/></div> <div><field name="phone"/></div> </div> </div> </div> </t> </templates> 

 </kanban>

estate_id is declared in my class


0
Imagine profil
Abandonează
Imagine profil
Kiran
Cel mai bun răspuns

Hello,

you can Simply use in kanban view <field > tag instead of <img> tag. like see in below code.

<field name="image_medium" nolabel="1" widget="image" class="oe_right oe_avatar"/>


it's worked for me

Thanks.

0
Imagine profil
Abandonează
Imagine profil
Hilar Andikkadavath
Cel mai bun răspuns

Make your image field storable in DB, if its a related field.


    image_medium = fields.Binary('Image', related='product_id.image_medium', store=True)

0
Imagine profil
Abandonează
Jignesh Mehta
Autor

Thanks for your answer, but i still get same error after add store=True in field definition.

Jignesh Mehta
Autor

Hello @Hilar AK, I tried with remove related field but same issue occurs. Can you help me on this ? Thanks,

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
TypeError: dict.record.id is undefined when I access to my custom kanban view in Odoo 11 Rezolvat
image view kanban odoo typeError
Imagine profil
Imagine profil
Imagine profil
2
mai 20
11292
Create Kanban View from Developer Mode
view kanban
Imagine profil
Imagine profil
Imagine profil
2
mai 20
6823
How do I attach imagees in a kanban view? Odoo 11.0 Rezolvat
view kanban
Imagine profil
Imagine profil
1
feb. 19
7832
how to show all the kanban state
view kanban
Imagine profil
0
ian. 19
6572
Design an Image gallery so that one can see pictures upladed by admin and rsize it as per as wish?
image kanban
Imagine profil
0
apr. 16
3010
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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