Jalena Blog

  • 首页
  • 程序开发
    • Java
    • Spring
    • SpringBoot
    • SpringMvc
    • Python
    • Odoo
    • C#
    • SQL
    • Web
    • Linux
  • 移动设备
    • Android
    • Router
  • 杂七杂八
    • 我的废话
    • 音频
    • 视频
    • 常用软件
  • 关于
  1. 首页
  2. 软件开发
  3. Python
  4. Odoo
  5. 正文

Odoo Widget 颜色的使用

2018-07-26

Tree视图定义行的颜色

<record id="purchase_order_tree" model="ir.ui.view">
	<field name="name">purchase.order.tree</field>
	<field name="model">purchase.order</field>
	<field name="arch" type="xml">
		<tree decoration-bf="message_unread==True" decoration-muted="state=='cancel'" decoration-info="state in ('wait','confirmed')" string="Purchase Order">
			<field name="message_unread" invisible="1"/>
			<field name="name" string="Reference"/>
			<field name="date_order" />
			<field name="partner_id"/>
			<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
			<field name="date_planned" invisible="context.get('quotation_only', False)"/>
			<field name="origin"/>
			<field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed" widget="monetary"/>
			<field name="amount_total" sum="Total amount" widget="monetary"/>
			<field name="currency_id" invisible="1"/>
			<field name="state"/>
			<field name="invoice_status" invisible="not context.get('show_purchase', True)"/>
		</tree>
	</field>
</record>

Kanban组件

color值为0~9

<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
<record id="view_forum_post_kanban" model="ir.ui.view">
	<field name="name">forum.post.kanban</field>
	<field name="model">forum.post</field>
	<field name="arch" type="xml">
		<kanban default_group_by="documentation_stage_id" >
			<field name="documentation_stage_id"/>
			<field name="create_uid"/>
			<field name="color"/>
			<templates>
			<t t-name="kanban-box">
				<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
					<div class="o_dropdown_kanban dropdown" groups="base.group_user">
						<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
							<li t-if="widget.editable"><a type="edit">Edit Post</a></li>
							<li t-if="widget.deletable"><a type="delete">Delete</a></li>
							<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
						</ul>
					</div>
				</div>
			</t>
			</templates>
		</kanban>
	</field>
</record>

Many2many_tag widget

值范围:1~12

<field name="about_place_route" widget="many2many_tags" options="{'color_field': 'color', 'no_open':True,'no_create':1,'no_create_edit':1}" />
标签: color odoo widget
最后更新:2019-01-01

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

【腾讯云】云服务器特惠热卖中
文章目录
  • Tree视图定义行的颜色
  • Kanban组件
  • Many2many_tag widget
标签聚合
java Centos odoo 其他 生活 wordpress docker MySql
分类
  • Android / 4篇
  • C# / 10篇
  • Codec / 9篇
  • Conversion / 14篇
  • Editing / 16篇
  • Java / 47篇
  • Javascript / 3篇
  • Linux / 30篇
  • Odoo / 25篇
  • Python / 6篇
  • SQL / 30篇
  • Web / 3篇
  • Windows / 4篇
  • 我的日记 / 10篇
  • 杂七杂八 / 93篇
  • 软件开发 / 72篇
  • 非线性编辑 / 1篇

COPYRIGHT © 2026 Jalena Blog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蜀ICP备17025376号