mrp : product quantity is modified with the factor

lp bug: https://launchpad.net/bugs/1200676 fixed

bzr revid: laetitia.gangloff@acsone.eu-20130712152235-lbfi12a0z29tw22a
This commit is contained in:
Laetitia Gangloff (Acsone) 2013-07-12 17:22:35 +02:00
parent d1a4e0aef0
commit a83c3a9591
1 changed files with 2 additions and 2 deletions

View File

@ -760,9 +760,9 @@ class mrp_production(osv.osv):
subproduct_factor = self._get_subproduct_factor(cr, uid, production.id, produce_product.id, context=context)
rest_qty = (subproduct_factor * production.product_qty) - produced_qty
if rest_qty < production_qty:
if rest_qty < (subproduct_factor * production_qty):
prod_name = produce_product.product_id.name_get()[0][1]
raise osv.except_osv(_('Warning!'), _('You are going to produce total %s quantities of "%s".\nBut you can only produce up to total %s quantities.') % (production_qty, prod_name, rest_qty))
raise osv.except_osv(_('Warning!'), _('You are going to produce total %s quantities of "%s".\nBut you can only produce up to total %s quantities.') % ((subproduct_factor * production_qty), prod_name, rest_qty))
if rest_qty > 0 :
stock_mov_obj.action_consume(cr, uid, [produce_product.id], (subproduct_factor * production_qty), context=context)