Adding an OWL field to the form view
Up to this point, we have learned about all the basics of OWL. Now we will move on to more advanced aspects and create a field widget that can be used in the form view, just like the field widget recipe from the previous chapter. In this recipe, we will create a color picker widget that will save integer values based on the color selected.
To make the example more informative, we will use some advanced concepts of OWL. We will use multiple components, custom events, external QWeb templates, and more.
For this recipe, we will continue using the
my_library module from the previous recipe.
How to do it...
- Add a color integer field to the
library.bookmodel as follows:
color = fields.Integer()
- Add the same field to the form view, with a widget attribute as well:
<field name="color" widget="int_color...