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

How to apply a workflow to old records ?

By
ando
on 6/17/15, 2:39 AM 613 views

I have create a new workflow 'stock.move.basic' for object 'stock.move', everything worked perfectly. But when I change and adde new activities and new transitions workflow, there is a problem, workflow walk only for new records created but for old records nothing works, the workflow buttons do nothing. I would like to know how to apply my workflow on all records (in OPENERP 7). thank you already for your answers.  

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 8/28/15, 7:31 AM

In openerp 7, To apply a workflow to old records try the below code in the button,


import netsvc

def action_name(self, cr, uid, ids, context=None):
wf_service = netsvc.LocalService("workflow")
wf_service.trg_delete(uid, 'object.name', ids[0], cr)
wf_service.trg_create(uid, 'object.njame', ids[0], cr)
#your code
return True


0
Anand Patel
On 8/28/15, 6:59 AM

Hello,

I am Facing same issue in manufacturing.

It would be great if somebody please help me in this.



Thanks,

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

1 follower(s)

Stats

Asked: 6/17/15, 2:39 AM
Seen: 613 times
Last updated: 8/28/15, 7:31 AM