Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to filter the selection of one field according the value of another field

形象
odoo
2 注释
形象
丢弃
形象
odoo
-

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).

形象
odoo
-

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!

2 答案
0
形象
odoo
最佳答案

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

形象
丢弃
0
形象
odoo
最佳答案

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 !!

形象
丢弃