Hi Odoo Community :)
I've installed the OCA module for storing a product's dimensions (https://github.com/OCA/product-attribute/tree/12.0/product_dimension ) which automatically calculates the volume field (by default cubic meters). Odoo's default product.template model volume field definition excludes the digits param (scale and precision) so whilst the auto calculated volume is persisted and stored in the db it isn't showing on the product form UI for very small volumes (e.g. a phone case). I solved this by adding the scale and precision of 17 and 17, respectively (taken from db table definition), to the volume field by extending the product.template model and adding the following line:
```
# override precision on volume field
volume = fields.Float(
'Volume', compute='_compute_volume', inverse='_set_volume', digits=(17, 17),
help="The volume in m3.", store=True)
```
As expected, the ui now shows the full 17 decimal places:
Logistics
Weight 0.00kg
Volume 0.00135200000000000m³
While this is great there's clearly too much precision for some things resulting in meaningless 0's so I'm wondering if it's possible to right strip the 0's by applying a string function pre output render so it's dynamic per product? e.g. pythons rstrip method:
>>> s = '0.00135200000000000'
>>> s.rstrip('0')
'0.001352'
Ideally the product's volume uom would be dynamic based on the stored dimension's uom but that's for another day :)
Wish you are all safe and well during this time and thanks for any help in advance!
Richard