2014-03-24 1 views
0

사용자가 구현중인 프로세스를 따라갈 수 있도록 워크 플로우 상태에 대한 변경 사항을 추적하는 방법이 있습니까?OpenERP 7.0에서 워크 플로우 변경을 추적하십시오.

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. 

그래서 요청을 만들 때 주먹 레코드가 삽입 될 것입니다, 워크 플로우 버튼 "제출"가 클릭하면 두 번째; 워크 플로 버튼 "검토"가 클릭 될 때 세 번째입니다.

어떤 생각이나 제안도 환영합니다!

감사 추적 레코드 사용은이 옵션이 아닙니다.

미리 감사드립니다. -FC.


I이 사용 self.pool.get ('obj_name')를 해결했다. 생성 (CR는 UID, 값)이 두 번째 테이블에 새로운 엔트리를 생성하기. 워크 플로가 변경 될 때마다, 예를 들어

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 

과 전화 :

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 

내가 여기를 떠날거야 내가 있던 같은 문제를 가진 사람을 도움을

이 기능을 사용 데. 팁 주셔서 감사합니다!

답변

0

테이블을 mail.thread 상속 받고 단추가 모든 팔로워에게 메시지를 보내도록하십시오.

class fnx_sr_shipping(osv.Model): 
    _name = 'fnx.sr.shipping' 
    _description = 'shipping & receiving' 
    _inherit = ['mail.thread'] 
    _mail_flat_thread = False 

    ... 

    def create(self, cr, uid, values, context=None): 
     ... 
     body = "some message" 
     follower_ids = [47, 29, 31] # actual ids here 
     ... 
     new_id = super(fnx_sr_shipping, self).create(cr, uid, values, context=context) 
     self.message_post(cr, uid, new_id, body=body, 
       partner_ids=follower_ids, subtype='mt_comment', 
       context=context) 
     return new_id 

    def sr_complete(self, cr, uid, ids, context=None): 
     ... 
     for id in ids: 
      current = self.browse(cr, uid, id, context=context) 
      if self.write(cr, uid, id, values, context=context): 
       context['mail_create_nosubscribe'] = True 
       followers = self._get_followers(cr, uid, [id], None, None, 
         context=context)[id]['message_follower_ids'] 
       message = 'Complete: ...' 
       self.message_post(cr, uid, id, body=message, subtype='mt_comment', 
         partner_ids=followers, context=context) 
     return True 

을 다음 XML 파일 :

<button string="Complete" name="sr_complete" type="object"/> 
+0

답변 해 주셔서 감사합니다.하지만 제 설명에서 명확하지 않았습니다. 변경 내용을 데이터베이스에 저장하고 각 요청의 추적을 폼보기의 페이지에 표시하고 싶습니다. 이 방법을 통해 사용자는 언제든지 프로세스 진화, 현재 상태 및 현재 상태를 볼 수 있습니다. –

+0

@FilipeCastanheira : 아마도 'OpenChatter'가 당신이 원하는 것일 것입니다. 양식보기 맨 아래에 보낸 모든 메시지를 표시합니다.그렇지 않으면'one2many' 링크가있는 별도의'history' 테이블을 만들고 거기에 항목을 기록한 다음'notebook'' 페이지로 추가해야합니다. –

+0

고마워, 나는 그것을 시도 할 것이다. –

0

I이 사용 self.pool를 해결 한 나는이 구현이 곳 여기

는 테이블 중 하나의 버전을 박탈이다 .get ('obj_name'). create (cr, uid, values)를 사용하여 두 번째 테이블에 새 항목을 만듭니다. 워크 플로가 변경 될 때마다, 예를 들어

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 

과 전화 :

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 

내가 여기를 떠날거야 내가 있던 같은 문제를 가진 사람을 도움을

이 기능을 사용 데.

관련 문제