Skip to content
Snippets Groups Projects
Commit c1a5221b authored by Tejas Shahu's avatar Tejas Shahu Committed by Arnold Moyaux
Browse files

[IMP] product: Dyanamic d.p. on Volume field

Decimal precision for volume on products is always set to 2.
Some users that work on more precise volume would like to increase it.
In order to do it without customisation we add another system parameter
for Volume.
parent 2590cf2e
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,10 @@
<field name="name">Stock Weight</field>
<field name="digits">2</field>
</record>
<record forcecreate="True" id="decimal_volume" model="decimal.precision">
<field name="name">Volume</field>
<field name="digits">2</field>
</record>
<record forcecreate="True" id="decimal_product_uom" model="decimal.precision">
<field name="name">Product Unit of Measure</field>
<field name="digits" eval="3"/>
......
......@@ -83,7 +83,7 @@ class ProductTemplate(models.Model):
help = "Cost used for stock valuation in standard price and as a first price to set in average/FIFO.")
volume = fields.Float(
'Volume', compute='_compute_volume', inverse='_set_volume', store=True)
'Volume', compute='_compute_volume', inverse='_set_volume', digits=dp.get_precision('Volume'), store=True)
volume_uom_name = fields.Char(string='Volume unit of measure label', compute='_compute_volume_uom_name', default=_get_default_volume_uom)
weight = fields.Float(
'Weight', compute='_compute_weight', digits=dp.get_precision('Stock Weight'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment