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