From 830acb128d8451bebb48c7ab14367d7488a12d57 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 29 Jan 2013 13:28:08 +0100 Subject: [PATCH] [IMP] purchase: use the new ORM methods create_workflow, delete_workflow, redirect_workflow. bzr revid: vmt@openerp.com-20130129122808-etp3ytphzn2cxnr1 --- addons/purchase/purchase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index bf3686d5a34..a45da4a2d61 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -487,8 +487,8 @@ class purchase_order(osv.osv): wf_service = netsvc.LocalService("workflow") for p_id in ids: # Deleting the existing instance of workflow for PO - wf_service.trg_delete(uid, 'purchase.order', p_id, cr) - wf_service.trg_create(uid, 'purchase.order', p_id, cr) + self.delete_workflow(cr, uid, [p_id]) # TODO is it necessary to interleave the calls? + self.create_workflow(cr, uid, [p_id]) return True def action_invoice_create(self, cr, uid, ids, context=None): @@ -797,7 +797,7 @@ class purchase_order(osv.osv): # make triggers pointing to the old orders point to the new order for old_id in old_ids: - wf_service.trg_redirect(uid, 'purchase.order', old_id, neworder_id, cr) + self.redirect_workflow(cr, uid, [(old_id, neworder_id)]) self.signal_purchase_cancel(cr, uid, [old_id]) # TODO Is it necessary to interleave the calls? return orders_info