This question has been flagged
3 Replies
3887 Views

Hi! I am filtering the list which retrieves a many2one field in a form containing stock locations but I have to hide one specific location, I added to the existing domain attribute of location_id (origin location) field and location_dest_id (destination location) the following condition:

domain="['|','|', ('company_id', '=', company_id), ('company_id', '=', False), ('location_id','!=',15)]"/>

15 is the id of the location that I don't want to show in the list, I'm doing with debug options from the view options, but after do some refresh at the page, that location keeps appearing in the list. Is something wrong with the conditions given in the domain attribute?

Avatar
Discard
Author Best Answer
Hi, Karthikeyan N R I tried your solution but it keeps showing the location and Paresh Wagh tried your solution too, actually it was the first solution got in mind to apply this filter, but raises the error: xmlParseEntityRef: no name, line 49, column 173. I'm in version 12 EE, Did I miss something?

Thanks for your help

Regards

Avatar
Discard

Hi,

I think your using the domain which Mr.Paresh told you in your xml, thats y xmlParseEntityRef: no name, line 49, column 173 occurs, please check this one,

https://www.odoo.com/forum/help-1/xmlsyntaxerror-xmlparseentityref-no-name-line-257-column-55-114463

Try replacing & with &

Best Answer

Hi,

Just remove any one of the pipeline symbol and try again,

domain="['|', ('company_id', '=', company_id), ('company_id', '=', False), ('location_id','!=',15)]"/>

Hope it works

Thanks

 

 
Avatar
Discard
Best Answer

Change the first | to & like so and it should work.

domain="['&','|', ('company_id', '=', company_id), ('company_id', '=', False), ('location_id','!=',15)]"/>
Avatar
Discard