Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3472 Vistas

Hell everybody,

I hope you can help me.

I want in Odoo studio make a filter of the selection of one field according the value selected from another field.


I have a Many2one field that allow me to select a contact customer

Attached to this customer i have contacts.

I have another Many2one field. I want the selection of this field filtered only with the contact of the customer selected. How can I do that in Odoo Studio ?

Thank's for your help, this problem makes me crazy

Avatar
Descartar

It is frustrating that Odoo not only doesn't allow you to enter this type of domain through the UI, it also flags it as invalid (which of course, it isn't).

I am having the same issue. I have a Customer Contact field in Contact form. If the Customer Contact is "Customer" then I want the next field Customer Category to only list certain values for Customer Contact and not Vendor Contacts. Any help on this would be great. I am having the same issue with the Domain.

I did go back and edit the XLM and added the correct domain. It worked perfect. There is bug in Odoo for sure on this!

Mejor respuesta

Hi Gilbert,

Studio can drive you crazy!

You can't do it directly from the Studio UI, but you can add a fixed domain filter and then edit the Extension View XML.

For example, to limit the delivery address on the invoice to be the same as the customer.

In studio, select the Field and click on domain


Enter a domain with Related Company as the field and the right hand side set as any customer

Then edit the  Extension View XML to select the partner_id field for filtering (rather than the single customer):


    [("parent_id", "=", partner_id)]
 

The result is like this: 

Note that because you are amending the Studio Extension View it should not get lost in any updates. 

More tips

Avatar
Descartar
Autor Mejor respuesta

Thank's for the response. I will do that but I wonder myself if this type of xml modification could be lost during an update version of Odoo ?


I have try, it works perfectlly.

I will save the xml file to avoid a loose on an update of Odoo.

What's totally stupid is, if I come back to studio on the domain of the field, studio show the the good formula but don't accept to save it due to an erro of domain. That would be great if this would be corrected in a future version of studio.

This type of filter is a commun use !!

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
1142
2
mar 25
1409
0
feb 25
1079
0
feb 25
1219
0
feb 25
1201