From ead299414fe5e6f530c161d2b0ad5d8b97dcf37d Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 17 Dec 2010 16:33:51 +0530 Subject: [PATCH] [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 --- addons/sale/sale.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index e5fcb1334fc..3190cd8944c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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)