تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
5648 أدوات العرض

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?

الصورة الرمزية
إهمال
الكاتب أفضل إجابة
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

الصورة الرمزية
إهمال

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 &

أفضل إجابة

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

 

 
الصورة الرمزية
إهمال
أفضل إجابة

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

domain="['&','|', ('company_id', '=', company_id), ('company_id', '=', False), ('location_id','!=',15)]"/>
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
5328
2
سبتمبر 23
8425
1
سبتمبر 23
2599
2
مارس 22
6437
2
أغسطس 20
4130