[FIX] start only one work order

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

bzr revid: fp@tinyerp.com-20110927142753-ma57g53ssxqofk5t
This commit is contained in:
Fabien Pinckaers 2011-09-27 16:27:53 +02:00
commit a515aad374
1 changed files with 6 additions and 2 deletions

View File

@ -235,6 +235,8 @@ class mrp_production(osv.osv):
obj = self.browse(cr, uid, ids)[0]
wf_service = netsvc.LocalService("workflow")
for workcenter_line in obj.workcenter_lines:
if workcenter_line.state == 'draft':
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr)
return super(mrp_production,self).action_production_end(cr, uid, ids)
@ -243,9 +245,11 @@ class mrp_production(osv.osv):
@return: True
"""
obj = self.browse(cr, uid, ids)[0]
workcenter_pool = self.pool.get('mrp.production.workcenter.line')
wf_service = netsvc.LocalService("workflow")
for workcenter_line in obj.workcenter_lines:
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
for prod in self.browse(cr, uid, ids):
if prod.workcenter_lines:
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', prod.workcenter_lines[0].id, 'button_start_working', cr)
return super(mrp_production,self).action_in_production(cr, uid, ids)
def action_cancel(self, cr, uid, ids, context=None):