You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Odoo创建视图时<field name="arch" type="xml">的type属性可选值有哪些?

Odoo arch Field type Attribute Options

Awesome question! When building views in Odoo, the type attribute on the arch field tells the system how to parse the view's structure. Let's break down the valid values you can use:

  • xml: This is the one you're probably most familiar with—it's the standard for almost all classic views: form, tree, kanban, calendar, pivot, graph, search, you name it. All those view definitions with XML tags go here, and it's what you'll use 90% of the time for day-to-day development.
  • json: Rolled out in newer Odoo versions (around v14 and later), this is for modern component-based views like the revamped list view or custom web components. Instead of XML tags, you define the view structure with JSON objects, which gives you more flexibility for building dynamic, interactive UIs.
  • html: A more niche option, used when you need to inject raw HTML directly into a view. Think static content pages, custom dashboards with full HTML control, or any scenario where XML or JSON doesn't give you the level of markup control you need.

Just a heads up—while xml is still the workhorse for most development tasks, json is gaining traction as Odoo evolves its web interface. html is best reserved for specific cases where you need full control over the view's markup.

内容的提问来源于stack exchange,提问作者Aadarsha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:02:54