Search code examples
xmlfieldodooodoo-13odoo-view

Odoo 13 How to edit field with Html widget from code?


I have field for description:

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

in XML form it looks like this:

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

The question is How can I insert table row with some value from code to this field?

I tried to write html markup as a text like this:

enter image description here

but it wraps as paragraph and displays as ordinary text.


Solution

  • your field definition should be as following:

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