Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

[SOLVED] How to set attrs in the view based on the condition of a selection field being blank?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
attrsviewfieldselectionsolved
1 Beantwoorden
16759 Weergaven
Avatar
Victor Admin

I have very much been enjoying customizing the user experience in the view by setting attrs based on the values of certain fields. But how do we check to see if the value has not been set yet? I haven't been able to figure it out

In the example below, this div is hidden if my selection field called x_sale_services_purchased, is set to any of the 3 values, but I want it to also be invisible if x_sale_services_purchased has not yet been set to anything:

 

<div style="background-color: #f0f0fa; border-radius: 5px; padding: 5px;" attrs="{'invisible': ['|','|','|','|',('x_sale_services_purchased','=','s_f'),('x_sale_services_purchased','=','s_web'),('x_sale_services_purchased','=','s_seo'),('x_sale_services_purchased','=','')]}"> </div>

 

The part in bold does not work (no error though). I have also tried 'NULL' with no success. What is the proper way to acheive this? I feel like I'm wandering into undocumented territory, although if documentation for this exists somewhere then please point me in the right direction! =) Thank you

0
Avatar
Annuleer
Avatar
Emipro Technologies Pvt. Ltd.
Beste antwoord

Hi Victor,

Use your attr as like below.

attrs="{'invisible': ['|','|','|',('x_sale_services_purchased','=','s_f'),('x_sale_services_purchased','=','s_web'), ('x_sale_services_purchased','=','s_seo'),('x_sale_services_purchased','=',False)]}"

It will work.

1
Avatar
Annuleer
Emipro Technologies Pvt. Ltd.

Hi Victor, Have you checked with my answer ? Is it ok for you ? Have you any another issue in this solution ? Then let me know. If it is good for you then accept my answer. Thanks for that.

Victor Admin
Auteur

Hello! I'm sorry for not responding sooner, I was pulled away from this project temporarily right after posting the question. I just tried and your answer - it works perfectly, and makes total sense. Thank you very much! I do not yet have enough karma to accept it as an answer (which seems like an odd design to me, seeing as it was me who asked the question) but I will add [SOLVED] to the subject and will come back when I have enough karma to mark your answer as accepted. Thanks again for your help!

Victor Admin
Auteur

By the way, is this aspect of multiple conditions for attrs documented anywhere? I gleaned the concept of it off of various forum posts, and came up with my method through trial and error, but it is such a cool and useful feature that I assume it has to be documented somewhere

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
field attribute invisible with boolean do not work
attrs form view field invisible
Avatar
Avatar
1
mrt. 24
31854
get Id in field selection
field selection
Avatar
Avatar
1
mrt. 15
9185
field visible as text for manager and dropdown for employee
field selection
Avatar
0
mrt. 15
4258
view xml, attrs use variable with attribute Opgelost
attrs xml view
Avatar
Avatar
1
mrt. 24
11380
How to use record.field.field in views domain?
attrs domain view
Avatar
Avatar
Avatar
3
aug. 22
5369
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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