[IMP] improve code for the button product

bzr revid: jap@tinyerp.com-20130503055934-8rrgvydvxkadwwxh
This commit is contained in:
Jagdish Panchal 2013-05-03 11:29:34 +05:30
parent cdb7c6603e
commit 45e461bd64
1 changed files with 3 additions and 0 deletions

View File

@ -775,6 +775,9 @@ class mrp_production(osv.osv):
for new_parent_id in new_parent_ids:
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
wf_service = netsvc.LocalService("workflow")
for componant in production.bom_id.bom_lines:
if componant.product_id.type == 'service' and not production.move_lines and not production.move_lines2:
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce', cr)
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
return True