我想根据选择字段隐藏一些字段。这些字段位于 TreeView 中。也没有代码
attrs="{'invisible':[('od_term_line','not in',('month'))]}"
也不是invisible="context.get('od_term_line','quart')"
,#quarts是不应该显示该值的选择值
invisible="context.get('od_term_line')!='month'"
有效
提前致谢
最佳答案
要像这样使用,首先您必须将选择字段值存储在列表中,然后将条件放入属性中。 它肯定会起作用。 谢谢
#In python file.
year = fields.Selection("put the all months here.")
list1 = []
for every_month in year:
list1.append(every_month):
<!--then condition like this in XML-->
<field attrs="{'invisible':[('january','not in',('year'))]}"/>
关于xml - 如何根据选择字段值隐藏 TreeView 中的某些列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49745942/