Using a float field with configurable precision
When using float fields, we may want to let the end user configure the precision that is to be used. The Decimal Precision Configuration module addon provides this ability.
We will add a Cost Price field to the Library Book model, with a user-configurable number of digits.
Getting ready
We will reuse the my_module
addon module from Chapter 4,Creating Odoo Addon Modules.
How to do it...
We need to install the decimal_precision
module, add a "Usage" entry for our configuration, and then use it in the model field:
- Ensure that the Decimal Accuracy module is installed; select
Apps
from the top menu, remove the default filter, search for theDecimal Precision Configuration
app, and install it if it's not already installed:

- Activate
Developer Mode
from the link in theSettings
menu (refer to the Activating the Odoo developer tools recipe in Chapter 1, Installing the Odoo Development Environment). This will enable theSettings
|Technical
menu. - Access the...