diff options
| author | Najlaâ <nel@tinyerp.com> | 2012-07-17 14:50:52 +0200 |
|---|---|---|
| committer | Najlaâ <nel@tinyerp.com> | 2012-07-17 14:50:52 +0200 |
| commit | 4eafdfe0173ddb4c108d4bb5b6f151b8ee5d29bb (patch) | |
| tree | be11044567034a5bb22ba84725701b3231937eb9 | |
| parent | 07b98520effde2dad656934ff67841779239537b (diff) | |
| parent | 5aaa2cfe75c8c3b2357fffb466989644085d025e (diff) | |
[FIX] mrp: compare quantities in production using float_compare
bzr revid: nel@tinyerp.com-20120717125052-fuq6ig6bx5114n4b
| -rw-r--r-- | addons/mrp/mrp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ed3872a855a..a52eb16f5e7 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -22,6 +22,7 @@ from datetime import datetime from osv import osv, fields import decimal_precision as dp +from tools import float_compare from tools.translate import _ import netsvc import time @@ -727,8 +728,7 @@ class mrp_production(osv.osv): if raw_product: # qtys we have to consume qty = total_consume - consumed_data.get(scheduled.product_id.id, 0.0) - - if qty > qty_avail: + if float_compare(qty, qty_avail, precision_rounding=scheduled.product_id.uom_id.rounding) == 1: # if qtys we have to consume is more than qtys available to consume prod_name = scheduled.product_id.name_get()[0][1] raise osv.except_osv(_('Warning!'), _('You are going to consume total %s quantities of "%s".\nBut you can only consume up to total %s quantities.') % (qty, prod_name, qty_avail)) |
