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

odoo8-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 this 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上跟踪错误。 如果出现问题,请检查是否已报告您的问题。 如果您首先发现了它,请提供详细且受欢迎的反馈,帮助我们粉碎它 here

学分

贡献者

维修人员

Odoo Community Association

此模块由OCA维护。

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

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

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

推荐PyPI第三方库


热门话题
JavaEclipseMars没有保存首选项   java梯度同步失败:原因:启动失败:   java如何从嵌套的JSON获取数据?   java如何判断可观察对象中的任何对象满足一个条件?   java将字符串转换为保持相同值的byte[]数组   java有没有办法绕过AuditingEntityListener为测试设置数据?   从/usr/share/java中解析linux JAR依赖关系   安卓 My java函数抛出nullpointerexception?   java Gradle使用正确版本的依赖项   JBoss和Java6中带注释的WebService中的web服务ClassCastException   java如何修复codename one中的简单逻辑错误?   java如何迭代矩阵的索引?   java如何在JPanel不可见时将其保存为图像?   java HashMap如何在Kotlin中实现MutableMap接口?   javascript如何在单击后加载特定片段?   EclipseJava为纳什均衡获取所有玩家/策略组合   JavaSpring:Web服务REST在JSON上产生双反斜杠   java为什么ServletContext#getRealPath(“/”)返回相对路径?   java当我的游戏应该重新启动时,我应该如何处理重置SurfaceView和线程?