Odoo中文网|Odoo实施培训
标题:
tree视图中设置字体及颜色
[打印本页]
作者:
店小2
时间:
2015-10-31 22:46
标题:
tree视图中设置字体及颜色
tree视图中根据一些条件设置具体的颜色 。例如:具体颜色取决于其状态。[attach]133[/attach]
<tree string=”session List”
colors=”blue:state==’draft'; green:state==’confirmed’ “>
<field name=”name”/>
<field name=”start_date”/>
<field name=”end_date”/>
<field name=”duration”/>
<field name=”seats”/>
<field name=”instructor_id”/>
<field name=”course_id”/>
<field name=”attendee_count”/>
<field name=”state” />
<field name=”taken_seats” widget=”progressbar”/>
</tree>
复制代码
不要忘记,字段列表中各条件的属性的设置 ,其中就包含颜色属性。
If state in either ‘confirmed’, ‘done’, ‘waiting’ :
colors=”blue: state in (‘confirmed’, ‘done’, ‘waiting’)”
if state is equal to ‘draft’:
colors=”blue: state==’draft’ “
if duration is greater than 5:
colors=”blue: duration > 5 “
if duration is less than 15:
colors=”blue: duration < 15 “
multiple conditions:
colors=”blue: state in (‘confirmed’, ‘done’, ‘waiting’) ; red: state==’draft’”
复制代码
字体
我们也可以通过设置属性的方式,进行字体的设置。例如
fonts=”bold:message_unread==True”设置粗体
欢迎光临 Odoo中文网|Odoo实施培训 (http://www.chinaodoo.net/)
Powered by Discuz! X3.2