Please review this at http://codereview.appspot.com/941041/show

Affected files:
  M move.py


Index: move.py
===================================================================
--- a/move.py
+++ b/move.py
@@ -427,6 +427,7 @@
         """
         uom_obj = self.pool.get('product.uom')
         product_obj = self.pool.get('product.product')
+        product_template_obj = self.pool.get('product.template')
         location_obj = self.pool.get('stock.location')
         currency_obj = self.pool.get('currency.currency')
         company_obj = self.pool.get('company.company')
@@ -464,6 +465,13 @@
         else:
             new_cost_price = product.cost_price

+        if hasattr(product_obj, 'cost_price'):
+            digits = product_obj.cost_price.digits
+        else:
+            digits = product_template_obj.cost_price.digits
+        new_cost_price = new_cost_price.quantize(
+                Decimal(str(10.0**-digits[1])))
+
         ctx = context.copy()
         ctx['user'] = user
         product_obj.write(



-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpmVrtEqDWYd.pgp
Description: PGP signature

Reply via email to