在odoo xml 中的属性
- class
用来设置XML样式, 与H5/CSS用法一样。
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
- attrs
筛选过滤条件, 按照domain的书写。
attrs="{'invisible': [('is_company','=', True)]}" #当is_company=True时,使用attrs的字段不显示
-
confirm
-
context
用于传递上下文数据
context="{'default_is_company': True}"
-
widget
样式类似于H5中的style -
eval
可以执行Python 代码块
<field name="groups" eval="[(4, ref('sales_team.group_sale_manager'))]"/>
-
operator
-
expand
-
xpath
用于定位XML文件中字段的位置
网友评论