Add patch to round production's cost
This commit is contained in:
parent
657c7267af
commit
7acbff4d09
|
@ -0,0 +1,24 @@
|
|||
# HG changeset patch
|
||||
# User Guillem Barba <guillembarba@gmail.com>
|
||||
return production's cost rounded to field's precision
|
||||
|
||||
|
||||
review14061002
|
||||
|
||||
Index: production.py
|
||||
===================================================================
|
||||
|
||||
--- a/trytond/trytond/modules/production/production.py
|
||||
+++ b/trytond/trytond/modules/production/production.py
|
||||
@@ -340,7 +340,9 @@
|
||||
else:
|
||||
cost_price = input_.product.cost_price
|
||||
cost += (Decimal(str(input_.internal_quantity)) * cost_price)
|
||||
- return cost
|
||||
+
|
||||
+ digits = self._fields['cost'].digits
|
||||
+ return cost.quantize(Decimal(str(10 ** -digits[1])))
|
||||
|
||||
@fields.depends('inputs')
|
||||
def on_change_with_cost(self):
|
||||
|
Loading…
Reference in New Issue