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

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第三方库


热门话题
java Libgdx手势监听器不适用于手机,但适用于桌面   json使用Java从MongoDB返回多个文档   Apache VFS的java SSH URI错误   java JPA createNativeQuery getResultList<Object[]>跳过空字段   java如何在没有ImageIO的情况下将加载的字节转换为图像。读()   类如何获取“导入java”。净。*'工作?   虽然引发了异常,但java事务未回滚   java正在从应用程序获取敏感数据。形态   java在当前线程结束后启动线程   分类如何在java代码中结合weka和LibSVM   java如何压缩图像直到达到固定字节大小   java与extras之间存在一些问题   带过滤器链接的java并行流   java生成ID高于某个值   IF语句可以在数学中使用吗。麦克斯在爪哇?   java JdbcTemplate如何在从数据库中删除表的情况下检索数据   如何在java中更新excel文件?   java无法运行JApplet,因为安全问题无法加载库   hh:mm格式的java时间条目   找不到java变量,即使它在上面的类中