允许您根据记录中的数据动态着色树视图中的字段
项目描述
在树视图中着色字段
本模块旨在为根据记录中的数据动态着色树视图中的字段添加支持。
它为具有与树标签中“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 上跟踪。如果遇到问题,请检查是否已报告您的问题。如果您是第一个发现它的,请通过提供详细和受欢迎的反馈来帮助我们解决它。
致谢
贡献者
Damien Crier <damien.crier@camptocamp.com>
Holger Brunn <hbrunn@therp.nl>
维护者
此模块由OCA维护。
OCA,或Odoo社区协会,是一个非营利组织,其使命是支持Odoo功能的协作开发并促进其广泛使用。
要为该模块做出贡献,请访问 https://odoo-community.org。
项目详情
关闭
哈希值 for odoo9_addon_web_tree_dynamic_colored_field-9.0.2.0.0.99.dev3-py2-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a0a3d939d966baf6fd5a0b58c9878d6f210564a160900a25e03b2af9ffa56f6d |
|
MD5 | b8b67fea5195874d946752f875ed276d |
|
BLAKE2b-256 | b7929fea4b5a0ffa8f914fe2cdba0cd34ec9d9feaf18caf6528d70b882ed64c8 |