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

Bug workaround - Dynamic Domains in Studio - Domain not properly formed

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
filterdomain_filterdynamicfilter_domainStudio
3 Antwoorden
3748 Weergaven
Avatar
IT Consultancy Sàrl

Hi, 


Hosting Variants: All Odoo hosting variants (Odoo SAAS, Odoo.SH, Odoo onPrem)

Versions: Odoo 15.0, Odoo 16.0 (other versions not tested)

App: Studio


Description: 

I try to create a dynamic domain using Studio but constantly receive a "Domain not properly formed" error. 

I have a field named "x_studio_species" which records the species of a record (e.g. "Cat"). 

I have a second field named "x_studio_shelter_box" which records the shelter/box where an animal is located (e.g. Shelter 1: Box 2). 

Both fields are their own models. The model for the shelter_box has a many_to_many (m2m) field named "x_studio_suitable_for" and records the species for which this box is suitable for (e.g. Shelter 1: Box 2 is suitable for Cats, Dogs, and Birds but Shelter 1: Box 1 is suitable only for Dogs). 


Suppose I'm trying to create a domain in Studio for the Animal form which selects only those boxes suitable for the selected species. Thus it should be a dynamic domain that should look like this: 


[["x_studio_suitable_for","like",x_studio_species]]


This however doesn't work, as you can't save the domain that way. It automatically creates it like this: (see quotes for x_studio_species")

[["x_studio_suitable_for","like","x_studio_species"]]


Thus the domain is created with a string instead of a variable. If I'm removing the quotes manually in the window, I get the message "Domain not properly formed"


How can I create a dynamic domain in Studio? ​Is this a bug and if so, is there a workaround?


Thanks in advance

1
Avatar
Annuleer
Avatar
IT Consultancy Sàrl
Auteur Beste antwoord

Hi again, 


Well I finally found the solution. 

When looking at the XML code that gets generated, it looks like this: 

   


So the domain is between double quotes and the respective fields are escaped double-quotes. 


By changing the XML-code of it to: 

   


It works perfectly. The domain is between double quotes but the fields themselves are between single quotes and the variable doesn't have any quotes and is recognized as a variable and not as a string. 


The only downside: I cannot modify the domain using the domain-wizard as this is not parsed correctly now. The form and domain are working correctly though. 



Solution: To create dynamic domains, generate the domain as desired, go (using debug-mode) to the XML file in "View" and modify the escaped double quotes " to ' (single quote). 

1
Avatar
Annuleer
Hardik Raval

Indeed, this worked for me. I tried to directly write the field name without single quote (') and it worked

Avatar
Eva@Ybo Services
Beste antwoord

Thanks a lot. I spent a lot of time before I found your answer and it also worked for me.

At the start I had " almost everywhere in my domain, then I changed according to your explanation and now it works perfectly.



Great.

1
Avatar
Annuleer
Avatar
Adil Akbar
Beste antwoord

Hi, you can follow this: https://youtu.be/f3mq5fHRPT0

Hope it helps, Thanks

0
Avatar
Annuleer
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
Add Filter inside the searchbar dynamically.
filter dynamic searchview filter_domain 17.0
Avatar
0
jun. 24
2238
Odoo 9.0 - Dynamic Custom Search Filter
filter search context dynamic filter_domain
Avatar
Avatar
2
okt. 16
8264
Default Domain Filter
filter domain_filter
Avatar
Avatar
Avatar
2
jun. 22
8197
Trying to filter a list using domain using studio (Odoo V14 Enterprise)
domain_filter Studio
Avatar
Avatar
1
jul. 21
3317
Filtration in xml view
filter domain_filter
Avatar
Avatar
2
feb. 16
4805
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