在 Odoo 中创建自己的报告:日期、客户 ID 等的 t 字段?

Creating own Report in Odoo: t-field for date, Customer ID etc.?

首先,我对 Odoo 有点陌生,我想了解一些基本逻辑。我根据 Odoo 的基本报告创建了自己的报告。

有很多字段,如 t-field="o.date_invoice"t-field="o.partner_id 等,它们工作得很好,但我在哪里可以找到所有功能?有没有名单?

例如,我需要一个用于订单日期和打印日期或客户 ID 的字段。

使用 t-field 属性,您可以访问和打印来自实际模型或相关模型的字段,例如使用以下元素,您可以打印 phone 列的内容(字段) 的实际记录:

<span t-if="o.phone" 
      t-field="o.phone" />

文档中t-field的解释:

The t-field directive can only be used when performing field access (a.b) on a "smart" record (result of the browse method). It is able to automatically format based on field type, and is integrated in the website's rich text edition.

检查 this link for further information if you want to build reports and this one,您可以在其中阅读有关可在 Qweb

中使用的一些元素的信息

此外,您可以检查here您可以在 Qweb 模板中使用的一些属性的列表