[FIX] Sale: called the button_check() method of procurement workflow to cancel procurement
lp bug: https://launchpad.net/bugs/588220 fixed bzr revid: mtr@mtr-20101217110351-hj8p28v4vjyupebb
This commit is contained in:
parent
0f29cf69e8
commit
ead299414f
|
@ -565,6 +565,11 @@ class sale_order(osv.osv):
|
|||
raise osv.except_osv(
|
||||
_('Could not cancel sales order !'),
|
||||
_('You must first cancel all picking attached to this sales order.'))
|
||||
for mov in pick.move_lines:
|
||||
proc_ids = self.pool.get('procurement.order').search(cr, uid, [('move_id', '=', mov.id)])
|
||||
if proc_ids:
|
||||
for proc in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc, 'button_check', cr)
|
||||
for r in self.read(cr, uid, ids, ['picking_ids']):
|
||||
for pick in r['picking_ids']:
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr)
|
||||
|
|
Loading…
Reference in New Issue