允许您动态为树视图上的字段上色

odoo10-addon-web-tree-dynamic-colored-field的Python项目详细描述


在树视图中为字段着色

此模块旨在添加对树视图中字段动态着色的支持 根据记录中的数据。

它在字段上提供与“colors”属性语法相同的属性 在树标记中。

此外,它在树标记上提供了一个color_field属性来使用字段的 值为颜色。

功能

  • 将字段上的属性bg_color添加到树状视图中单元格的颜色背景
  • 在字段上添加属性fg_color,以更改树视图中单元格的文本颜色
  • 在树元素上添加属性color_field以用作颜色

用法

  • 在树状图声明中,将bg_color=“red:customer==true;”属性放入字段标记:

    ...
    <field name="arch" type="xml">
        <tree string="View name">
            ...
            <field name="name" bg_color="red:customer==True;"/>
            ...
        </tree>
    </field>
    ...
    
    With this example, column which renders 'name' field will have its background colored in red.
    
  • 在树状图声明中,将fg_color=“white:customer==true;”属性放入字段标记:

    ...
    <field name="arch" type="xml">
        <tree string="View name">
            ...
            <field name="name" fg_color="white:customer==True;"/>
            ...
        </tree>
    </field>
    ...
    
    With this example, column which renders 'name' field will have its text colored in white.
    
  • 在树视图声明中,使用树标记中的color_field=“color”属性:

    ...
    <field name="arch" type="xml">
        <tree string="View name" color_field="color">
            ...
            <field name="color" invisible="1" />
            ...
        </tree>
    </field>
    ...
    
    With this example, the content of the field named `color` will be used to
    populate the `color` CSS value. Use a function field to return whichever
    color you want depending on the other record values. Note that this
    overrides the `colors` attribute, and that you need the tree to load your
    field in the first place by adding it as invisible field.
    

错误跟踪程序

GitHub Issues上跟踪错误。如果有麻烦,请 如果您的问题已经报告,请检查那里。如果你先发现它, 通过提供详细而受欢迎的反馈,帮助我们粉碎它。

学分

贡献者

维修人员

Odoo Community Association

此模块由OCA维护。

oca,或odoo社区协会,是一个非营利性组织 任务是支持odoo特性和 促进其广泛应用。

若要对此模块作出贡献,请访问https://odoo-community.org

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
空字符串检查在java中未按预期工作   JavaSpringWebClient:自动计算主体的HMAC签名并将其作为头传递   foreach是否有一个Java等效的foreach循环和一个引用变量?   java如何在Eclipse中导入jar   使用特定第三方或java时lombok触发错误。*方法或构造函数   安卓 java将对象数组转换为int数组   java使一定百分比的JUnit测试通过   java Android:将Seekbar的一个值与另一个值进行比较   java将int数组(图像数据)写入文件的最佳方式是什么   java取代了系统。yml的构造函数内的getProperty   sqlite Java将公钥和私钥转换为字符串,然后再转换回字符串   安卓获取白色像素并将其保存到java opencv中的数组中   java为什么是ServerSocket。setSocketFactory静态?   Java数组似乎在不直接修改的情况下更改值