[FIX] Sale/Purchase : Worfklow instance had to ve removed while setting record's workflow back to draft state
lp bug: https://launchpad.net/bugs/401801 fixed bzr revid: jvo@tinyerp.com-20100205113525-5l4pb805w19s6c9q
This commit is contained in:
parent
98c0c35044
commit
3c9f4f2fac
|
@ -300,6 +300,8 @@ class purchase_order(osv.osv):
|
||||||
self.write(cr, uid, ids, {'state':'draft','shipped':0})
|
self.write(cr, uid, ids, {'state':'draft','shipped':0})
|
||||||
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
|
||||||
|
wf_service.trg_delete(uid, 'purchase.order', p_id, cr)
|
||||||
wf_service.trg_create(uid, 'purchase.order', p_id, cr)
|
wf_service.trg_create(uid, 'purchase.order', p_id, cr)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,8 @@ class sale_order(osv.osv):
|
||||||
self.pool.get('sale.order.line').write(cr, uid, line_ids, {'invoiced': False, 'state': 'draft', 'invoice_lines': [(6, 0, [])]})
|
self.pool.get('sale.order.line').write(cr, uid, line_ids, {'invoiced': False, 'state': 'draft', 'invoice_lines': [(6, 0, [])]})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
for inv_id in ids:
|
for inv_id in ids:
|
||||||
|
# Deleting the existing instance of workflow for SO
|
||||||
|
wf_service.trg_delete(uid, 'sale.order', inv_id, cr)
|
||||||
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
|
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue