允许您根据记录中的数据动态着色树视图中的字段
项目描述
在树视图中着色字段
此模块旨在根据记录中的数据在树视图中动态着色字段以提供支持。
它提供了与树标签中“颜色”属性相同的语法在字段上定义属性。
此外,它还提供了树标签上的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上跟踪。如果在那里找不到您的问题,请检查是否已经报告。如果您是第一个发现它的人,请帮助我们通过提供详细且受欢迎的反馈在此。
致谢
贡献者
Damien Crier <damien.crier@camptocamp.com>
Holger Brunn <hbrunn@therp.nl>
维护者
此模块由OCA维护。
OCA,或Odoo社区协会,是一个非营利组织,其使命是支持Odoo功能的协作开发并推广其广泛使用。
为贡献此模块,请访问 http://odoo-community.org。
项目详情
关闭
散列值 for odoo8_addon_web_tree_dynamic_colored_field-8.0.2.0.0.99.dev9-py2-none-any.whl
算法 | 散列摘要 | |
---|---|---|
SHA256 | 20f39c7711eba248145070e2793546b115e48f0cf4d02d1ad1ba395725c8b67d |
|
MD5 | 1aad638757cdb43b03aa102a5cc87d74 |
|
BLAKE2b-256 | 75fea4a5853f711a6dfd84834507885c44f0c1a1416a0e1f481ff35b0217b7dc |