[IMP] purchase: use the new ORM methods create_workflow, delete_workflow, redirect_workflow.
bzr revid: vmt@openerp.com-20130129122808-etp3ytphzn2cxnr1
This commit is contained in:
parent
45ba35783f
commit
830acb128d
|
@ -487,8 +487,8 @@ class purchase_order(osv.osv):
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
for p_id in ids:
|
for p_id in ids:
|
||||||
# Deleting the existing instance of workflow for PO
|
# Deleting the existing instance of workflow for PO
|
||||||
wf_service.trg_delete(uid, 'purchase.order', p_id, cr)
|
self.delete_workflow(cr, uid, [p_id]) # TODO is it necessary to interleave the calls?
|
||||||
wf_service.trg_create(uid, 'purchase.order', p_id, cr)
|
self.create_workflow(cr, uid, [p_id])
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_invoice_create(self, cr, uid, ids, context=None):
|
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
|
# make triggers pointing to the old orders point to the new order
|
||||||
for old_id in old_ids:
|
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?
|
self.signal_purchase_cancel(cr, uid, [old_id]) # TODO Is it necessary to interleave the calls?
|
||||||
return orders_info
|
return orders_info
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue