[Fix]MRP:Again Optimize code
bzr revid: aag@tinyerp.co.in-20110420121256-9eofhp13s17sddud
This commit is contained in:
parent
fa1b3c285b
commit
cdf19b641e
|
@ -139,8 +139,6 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
flag = True
|
||||
for line in obj:
|
||||
if line.state != 'done':
|
||||
if line.state == 'draft':
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', line.id, 'button_start_working', cr)
|
||||
flag = False
|
||||
if flag:
|
||||
for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
|
||||
|
@ -238,6 +236,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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue