Odooers论坛

欢迎!

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


0

[SOLVED] How to set attrs in the view based on the condition of a selection field being blank?

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

Hi Victor,

Use your attr as like below.

attrs="{'invisible': ['|','|','|',('x_sale_services_purchased','=','s_f'),('x_sale_services_purchased','=','s_web'), ('x_sale_services_purchased','=','s_seo'),('x_sale_services_purchased','=',False)]}"

It will work.

3 注释
形象
丢弃
形象
odoo
-

Hi Victor, Have you checked with my answer ? Is it ok for you ? Have you any another issue in this solution ? Then let me know. If it is good for you then accept my answer. Thanks for that.

形象
odoo
-

Hello! I'm sorry for not responding sooner, I was pulled away from this project temporarily right after posting the question. I just tried and your answer - it works perfectly, and makes total sense. Thank you very much! I do not yet have enough karma to accept it as an answer (which seems like an odd design to me, seeing as it was me who asked the question) but I will add [SOLVED] to the subject and will come back when I have enough karma to mark your answer as accepted. Thanks again for your help!

形象
odoo
-

By the way, is this aspect of multiple conditions for attrs documented anywhere? I gleaned the concept of it off of various forum posts, and came up with my method through trial and error, but it is such a cool and useful feature that I assume it has to be documented somewhere