Odoo Help


"go back" step in a workflow stops everything

Tarek Mohamed Ibrahim
on 4/27/15, 12:21 AM 1,425 views

I created a set of approvals in a Purchase Order workflow, I added a rejection step among the workflow steps. The approvals flow smoothly, my problem is that when rejecting one approval and get back to the previous workflow state everything stops and is then unable to change the state by clicking the current approval


Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 4/27/15, 12:25 AM

whenever go back in any workflow one should delete then create the workflow related records in workflow tables, I faced enourmouse difficuties due to the lack of this piece of information, I put it here to share information

pls check the method action_cancel_draft in purchase.py

    def action_cancel_draft(self, cr, uid, ids, context=None):
if not len(ids):
return False
self.write(cr, uid, ids, {'state':'draft','shipped':0})
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)
return True

Hi Tarek, I'm facing the same problem as you. I'm trying to implement your solution but I don't understand what the "self.write(cr, uid, ids, {'state':'draft','shipped':0})" line does

Sirius Fuenmayor
on 12/4/15, 12:23 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/27/15, 12:21 AM
Seen: 1425 times
Last updated: 6/6/15, 2:36 PM