Round cost price before writing for issue1523
This commit is contained in:
1 parent
027d5ad213
commit
c2c47b2ea2
1 file changed
+8
@@ -427,6 +427,7 @@ class Move(ModelSQL, ModelView):
|
||||
"""
|
||||
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 @@ class Move(ModelSQL, ModelView):
|
||||
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(
|
||||
|
||||
Reference in new issue
Block a user