[IMP]mrp,mrp_subproducts: Optimize code - remove dic res
bzr revid: aag@tinyerp.com-20110817100831-hrtypdvv921sz5o8
This commit is contained in:
+1
-2
@@ -682,8 +682,7 @@ class mrp_production(osv.osv):
|
||||
return res
|
||||
|
||||
def rest_qty_compute(self, cr, uid, obj, move_obj=None, context=None):
|
||||
res = {'product_qty': obj.product_qty, 'sub_qty': 1}
|
||||
return res
|
||||
return {'product_qty': obj.product_qty, 'sub_qty': 1}
|
||||
|
||||
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None):
|
||||
""" To produce final product based on production mode (consume/consume&produce).
|
||||
|
||||
@@ -103,8 +103,7 @@ class mrp_production(osv.osv):
|
||||
sub_id = sub_obj.search(cr, uid,[('product_id', '=', move_obj.product_id.id)] )
|
||||
if sub_id:
|
||||
sub_qty = sub_obj.browse(cr ,uid, sub_id[0]).product_qty
|
||||
res = {'product_qty': obj.product_qty * sub_qty, 'sub_qty': sub_qty}
|
||||
return res
|
||||
return {'product_qty': obj.product_qty * sub_qty, 'sub_qty': sub_qty}
|
||||
|
||||
mrp_production()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user