Reviewers: ,


Please review this at http://codereview.tryton.org/600003/

Affected files:
  M production.py


Index: production.py
===================================================================

--- a/production.py
+++ b/production.py
@@ -397,6 +397,7 @@

factor = self.bom.compute_factor(self.product, self.quantity, self.uom)
         cost = Decimal(0)
+        digits = Pool().get('product.template').cost_price.digits[1]
         for input_ in self.bom.inputs:
             quantity = input_.compute_quantity(factor)
             product = input_.product
@@ -415,7 +416,9 @@
             if move:
                 move.production_output = self
                 if product == self.product:
-                    move.unit_price = cost / Decimal(str(quantity))
+                    move.unit_price = Decimal(
+                        cost / Decimal(str(quantity))
+                        ).quantize(Decimal(str(10 ** -digits)))
                 move.save()
         self._set_move_planned_date()




--
--
[email protected] mailing list



Reply via email to