mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
24 lines
710 B
Diff
24 lines
710 B
Diff
# 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):
|
|
|