Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

V14 t-if with custom selection field

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
selectiont-ifv14
1 Atsakyti
3299 Rodiniai
Portretas
Tristan Fullmer

I've added a custom selection field in my module and I'd like to show a little icon depending on what is selected. I got all the icons showing up and the selection field working as expected, but the problem comes when I try and show only one icon at a time. Here's the code:

<span>
<
span t-if="record.order_type == 'delivery'" class="fa fa-bus"></span>
<
span t-if="record.order_type == 'store'" class="fa fa-cart-arrow-down"></span>
<
span t-if="record.order_type == 'online'" class="fa fa-laptop"></span>
</
span>
When I added the t-if attributes, nothing showed up. I looked around at other forum posts and at the xml for other kanban views and tried adding ".value" or ".raw_value" after order_type, but that only gave me an error:
Traceback:
TypeError: Cannot read property 'value' of undefined
at Engine.eval (eval at _render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4426:73), <anonymous>:181:32)
at Engine._render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4425:296)
at Engine.render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4425:151)
at Engine._render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4429:57)
at Engine.render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4425:151)
at Class._render (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/606-2e24acc/web.assets_backend.js:2489:561)
at Class.start (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/606-2e24acc/web.assets_backend.js:2481:1273)
at Class.prototype.<computed> [as start] (https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4619:488)
at https://tfqoc-lumeprep2-customerflow-2129849.dev.odoo.com/web/content/534-fa1f61a/web.assets_common.js:4950:52
at async Promise.all (index 1)
So it looks like order_type is undefined on the model. However, this is a field that I added, so I know it exists.

I tried adding a t-if on the parent <span> with just "record.order_type" and nothing showed up at all.

So after trying all that, I'm left with one question: How do I access/check field values on my model with t-if?


0
Portretas
Atmesti
Portretas
Dharmrajsinh Jhala (dja)
Best Answer

You have to add that field in the kanban view, right after you start <kanban> tag.

        

1
Portretas
Atmesti
Tristan Fullmer
Autorius

Yep, that was exactly it! Thanks for the quick response!

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

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

Registracija
Related Posts Replies Rodiniai Veikla
[14] Cannot able to remove the option from Selection field Solved
selection v14
Portretas
Portretas
Portretas
Portretas
3
rugp. 24
8657
Make selection invisible when already selected
selection v14
Portretas
Portretas
1
rugs. 22
2601
Dynamic selection field based on another field (Odoo 14)
fields selection integer v14
Portretas
Portretas
Portretas
2
rugs. 23
6987
Default property does not apply when overriding selection field.
default field selection v14
Portretas
0
liep. 21
94
odoo14 Wizard fiealds become False on button press
wizard fields selection v14
Portretas
Portretas
1
geg. 21
3378
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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