Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
filterdomain_filterdynamicfilter_domainStudio
3 Réponses
3754 Vues
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
Ignorer
Avatar
IT Consultancy Sàrl
Auteur Meilleure réponse

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
Ignorer
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
Meilleure réponse

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
Ignorer
Avatar
Adil Akbar
Meilleure réponse

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

Hope it helps, Thanks

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Add Filter inside the searchbar dynamically.
filter dynamic searchview filter_domain 17.0
Avatar
0
juin 24
2246
Odoo 9.0 - Dynamic Custom Search Filter
filter search context dynamic filter_domain
Avatar
Avatar
2
oct. 16
8272
Default Domain Filter
filter domain_filter
Avatar
Avatar
Avatar
2
juin 22
8197
Trying to filter a list using domain using studio (Odoo V14 Enterprise)
domain_filter Studio
Avatar
Avatar
1
juil. 21
3319
Filtration in xml view
filter domain_filter
Avatar
Avatar
2
févr. 16
4809
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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