From 415401f3e755a2cf5b7a7b9f4de6fad022af0e45 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 18 Jun 2015 11:29:38 +0200 Subject: [PATCH] [FIX] mrp: action_produce Introduced by #6451 The method "precision_get" returns the precision in digits. opw:642773 --- addons/mrp/mrp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 7ca680ad762..0a3a0941a70 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -957,7 +957,7 @@ class mrp_production(osv.osv): location_id=produce_product.location_id.id, restrict_lot_id=lot_id, context=context) stock_mov_obj.write(cr, uid, new_moves, {'production_id': production_id}, context=context) remaining_qty = subproduct_factor * production_qty_uom - qty - if not float_is_zero(remaining_qty, precision_rounding=precision): + if not float_is_zero(remaining_qty, precision_digits=precision): # In case you need to make more than planned #consumed more in wizard than previously planned extra_move_id = stock_mov_obj.copy(cr, uid, produce_product.id, default={'product_uom_qty': remaining_qty, @@ -988,7 +988,7 @@ class mrp_production(osv.osv): stock_mov_obj.action_consume(cr, uid, [raw_material_line.id], consumed_qty, raw_material_line.location_id.id, restrict_lot_id=consume['lot_id'], consumed_for=main_production_move, context=context) remaining_qty -= consumed_qty - if not float_is_zero(remaining_qty, precision_rounding=precision): + if not float_is_zero(remaining_qty, precision_digits=precision): #consumed more in wizard than previously planned product = self.pool.get('product.product').browse(cr, uid, consume['product_id'], context=context) extra_move_id = self._make_consume_line_from_data(cr, uid, production, product, product.uom_id.id, remaining_qty, False, 0, context=context)