【问题标题】:Odoo 13 How to edit field with Html widget from code?Odoo 13 如何从代码中使用 Html 小部件编辑字段?
【发布时间】:2021-02-26 22:16:44
【问题描述】:

我有描述字段:

test_field = fields.Char(string='Test')

XML 格式如下所示:

<field name="test_field" widget="html" />

问题是如何将具有代码中某些值的表行插入到该字段中?

我尝试将 html 标记写成这样的文本:

但它作为段落换行并显示为普通文本。

【问题讨论】:

    标签: xml field odoo odoo-13 odoo-view


    【解决方案1】:

    您的字段定义应如下所示:

    test_field = fields.Html(string='Test')
    

    【讨论】:

      猜你喜欢
      • 2014-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-06
      • 2021-12-05
      • 2021-12-28
      • 1970-01-01
      相关资源
      最近更新 更多