【问题标题】:How to hide certain columns in tree view based on selection field value?如何根据选择字段值隐藏树视图中的某些列?
【发布时间】:2018-04-10 05:26:33
【问题描述】:

我想根据选择字段隐藏一些字段。这些字段在树视图中。既不是代码 attrs="{'invisible':[('od_term_line','not in',('month'))]}"

也不是invisible="context.get('od_term_line','quart')",#quarts是不应该显示值的选择值

invisible="context.get('od_term_line')!='month'" 有效

提前致谢

【问题讨论】:

    标签: xml odoo-10


    【解决方案1】:

    首先要像这样使用,您必须将选择字段值存储在列表中,然后将条件放入 attrs。 它肯定会奏效。 谢谢

        #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'))]}"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 2013-02-23
      • 2017-02-02
      • 2019-04-05
      相关资源
      最近更新 更多