
Odoo 14 Development Cookbook
By :

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.
Perform the following steps to add a new OWL field component to choose the colors on the form view:
library.book
model as follows:color = fields.Integer()
<field name="color" widget="int_color...