I have a HTML-field in my model.py
like this:
from odoo import models, fields
class TestModel(models.model):
_name = 'test.model'
content = fields.HTML()
To display the data of my model I used <field name="content" widget='html'>
in the corresponding view
file.
Now I want to add predefined data, when the module is first installed.
Normally, I add data inside the data
folder with .xml
files.
So I created an .xml with the following content:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="unique_id" model="test.model">
<field name="content">
<p>Some Text</p>
</field>
</record>
</data>
</odoo>
But I end up getting parsing errors like this:
File "/Path/to/my/odoo/installation/odoo/tools/convert.py", line 782, in convert_xml_import
relaxng.assert_(doc)
File "src/lxml/etree.pyx", line 3633, in lxml.etree._Validator.assert_
AssertionError: Element odoo has extra content: data, line 3
What am I doing wrong or do I have a complete wrong understanding of how the HTML-field works?
Any help is appreciated.