Hi,
I'm working on Odoo 18 and I’d like to filter two fields so that when I select one, I can see only the available services in the second field.
I believe I need to use a domain, but whether I try to edit it through XML or the domain editor, the changes I make only result in errors.
Using the domain editor, I’m able to create relationships to filter fields, but I can’t see the two specific fields—only the more “general” ones.
How can I view the correct fields or create this kind of relationship?
I'm using many2one fields.
Code:
<data>
<xpath expr="//field[@name='x_name']" position="attributes">
<attribute name="force_save">1</attribute>
<attribute name="placeholder"/>
<attribute name="readonly">True</attribute>
<attribute name="required">True</attribute>
<attribute name="string">Nuovo Pasto</attribute>
</xpath>
<xpath expr="//group[@name='studio_group_ced1b4_left']" position="attributes">
<attribute name="string">Scelta del centro cottura</attribute>
</xpath>
<xpath expr="//group[@name='studio_group_ced1b4_left']" position="inside">
<field name="x_studio_sede" options="{"create_name_field":"x_name","no_create":true}" required="True"/>
</xpath>
<xpath expr="//group[@name='studio_group_ced1b4_right']" position="attributes">
<attribute name="string">selezionare il servizio</attribute>
</xpath>
<xpath expr="//group[@name='studio_group_ced1b4_right']" position="inside">
<field name="x_studio_servizio_associato_1" options="{"create_name_field":"x_name","no_create":true,"no_open":true}" domain="[]"/>
<field name="x_studio_one2many_field_83p_1ivnpm9br"/>
</xpath>
<xpath expr="//group[@name='studio_group_ced1b4']" position="after">
<group name="studio_group_8oe_1ivnm11ti">
<group name="studio_group_8oe_left" string="Numero pasti prodotti per servizio">
<field name="x_studio_pasti_adulti"/>
<field name="x_studio_pasti_bambini"/>
</group>
<group name="studio_group_8oe_right">
<field name="x_studio_many2one_field_20q_1ivqabq8b"/>
</group>
</group>
<group name="studio_group_2co_1ivnllih7" string="Info">
<field name="create_date" force_save="1" readonly="True" widget="datetime" options="{"show_seconds":false}" string="Creato da"/>
<field name="write_date" force_save="1" readonly="True" string="Ultimo agg il"/>
<field name="create_uid" force_save="1" readonly="True" string="Creato da"/>
<field name="write_uid" string="Ultimo agg da"/>
</group>
</xpath>
</data>
Thank you :)
Is your first post relate to it? https://www.odoo.com/forum/1/281582