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

Keep track of workflow change in OpenERP 7.0

By
Luis Filipe Castanheira
on 3/24/14, 9:07 AM 1,550 views

Hi,

Is there a way to keep track of changes made on workflow status so that users can follow through the process I'm implementing.

Ex:
Created on March 1st, by User 1.
Submitted on March 1st, by User 1.
Reviewing on March 2nd, by Admin.
Evaluating on March 4th, by SuperUser.
Accepted on March 6th, by MegaUser.

So, the fists record would be inserted when the request is created, the second when the workflow button "submit" is clicked; the third when the workflow button "review" is clicked and so on.

Any thoughts or sugestions are more than welcome!

Using the records of Audit Trail is not an option for this.

Thanks in advance. -FC.

0

I've solved this using self.pool.get('obj_name').create(cr, uid,values) to create new entries in that second table.

used this function:

def insert_trace(self, cr, uid, id_request, context=None):
    request = self.browse(cr, uid, id_request, context)
    values = { 
        'generic_request_id':  id_request[0],
        'executor': self._get_user(cr, uid, context),
        'state': request[0].state,
    }
    tracing_ids = self.pool.get('tracing').create(cr, uid,values)
    return True

and called it, each time workflow changed, e.g:

def request_draft(self, cr, uid, ids, context=None):
    self.write(cr, uid, ids, {'state': 'draft'})
    self.insert_trace(cr, uid, ids,  context)
    return True

def submit_request(self, cr, uid, ids, context=None):
    self.write(cr, uid, ids, {'state': 'submitted'})
    self.insert_trace(cr, uid, ids, context)
    return True

I'll leave this here, to help anyone with the same problem that I was having.

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: 3/24/14, 9:07 AM
Seen: 1550 times
Last updated: 3/16/15, 8:10 AM