Odoo Help

Welcome!

This community 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.

0

"go back" step in a workflow stops everything

By
Tarek Mohamed Ibrahim
on 4/27/15, 12:21 AM 823 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

0

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
896
| 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.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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